Setting that this document extends another document.

@access protected

@param \Htsl\ReadingBuffer\Line $firstLine

@return \Htsl\Parser\Document
323451
protected function setExtending( Line$firstLine ):self
	{
		switch( $name= $firstLine->pregGet('/(?<=^@)[\w-:]+/') ){
			default:{
				$this->throw("The @$name is not supported.");
			}break;
			case 'extend':{
				$this->extend($firstLine->pregGet('/(?<=\( ).*(?= \))/'));
			}break;
			case 'show':
			case 'include':
			case 'section':{
				$this->throw("The @$name can not be used on first line.");
			}break;
		}

		return $this;
	}
381781
protected function parseLine(&$line)
    {
        switch ($this->state) {
        case self::STATE_BEGIN:
            if (trim($line)) {
                if ($this->isListLine($line)) {
                    $this->state = self::STATE_LIST;
                    $this->buffer = $this->kernel->build('Nodes\ListNode');
                    $this->lineInfo = null;
                    $this->listFlow = true;
                    return false;
                } else if ($this->isBlockLine($line)) {
                    if ($this->isCode) {
                        $this->state = self::STATE_CODE;
                    } else {
                        $this->state = self::STATE_BLOCK;
                    }
                    return false;
                } else if ($this->isDirective($line)) {
                    $this->state = self::STATE_DIRECTIVE;
                    $this->buffer = array();
                    $this->flush();
                    $this->initDirective($line);
                } else if ($this->parseLink($line)) {
                    return true;
                } else if ($parts = $this->parseTableLine($line)) {
                    $this->state = self::STATE_TABLE;
                    $this->buffer = $this->kernel->build('Nodes\TableNode', $parts);
                } else {
                    $this->state = self::STATE_NORMAL;
                    return false;
                }
            }
            break;

        case self::STATE_LIST:
            if (!$this->pushListLine($line)) {
                $this->flush();
                $this->state = self::STATE_BEGIN;
                return false;
            }
            break;

        case self::STATE_TABLE:
            if (!trim($line)) {
                $this->flush();
                $this->state = self::STATE_BEGIN;
            } else {
                $parts = $this->parseTableLine($line);

                if (!$this->buffer->push($parts, $line)) {
                    $this->flush();
                    $this->state = self::STATE_BEGIN;
                    return false;
                }
            }

            break;

        case self::STATE_NORMAL:
            if (trim($line)) {
                $specialLetter = $this->isSpecialLine($line);

                if ($specialLetter) {
                    $this->specialLetter = $specialLetter;
                    $lastLine = array_pop($this->buffer);

                    if ($lastLine) {
                        $this->buffer = array($lastLine);
                        $this->state = self::STATE_TITLE;
                    } else {
                        $this->buffer[] = $line;
                        $this->state = self::STATE_SEPARATOR;
                    }
                    $this->flush();
                    $this->state = self::STATE_BEGIN;
                } else {
                    if ($this->isDirective($line)) {
                        $this->flush();
                        $this->state = self::STATE_BEGIN;
                        return false;
                    }
                    if ($this->isComment($line)) {
                        $this->flush();
                        $this->state = self::STATE_COMMENT;
                    } else {
                        $this->buffer[] = $line;
                    }
                }
            } else {
                $this->flush();
                $this->state = self::STATE_BEGIN;
            }
            break;
        
        case self::STATE_COMMENT:
            $isComment = false;

            if (!$this->isComment($line) && (!trim($line) || $line[0] != ' ')) {
                $this->state = self::STATE_BEGIN;
                return false;
            }
            break;

        case self::STATE_BLOCK:
        case self::STATE_CODE:
            if (!$this->isBlockLine($line)) {
                $this->flush();
                $this->state = self::STATE_BEGIN;
                return false;
            } else {
                $this->buffer[] = $line;
            }
            break;

        case self::STATE_DIRECTIVE:
            if (!$this->directiveAddOption($line)) {
                if ($this->isDirective($line)) {
                    $this->flush();
                    $this->initDirective($line);
                } else {
                    $directive = $this->getCurrentDirective();
                    $this->isCode = $directive ? $directive->wantCode() : false;
                    $this->state = self::STATE_BEGIN;
                    return false;
                }
            }
            break;

        default:
            $this->getEnvironment()->getErrorManager()->error('Parser ended in an unexcepted state');
        }

        return true;
    }
1211979
protected function getLine():Line
	{
		do{
			$line= $this->buffer->getLine();
		}while( $line->isEmpty() && $line->hasMore() );

		return $line;
	}
1165533
protected function parseDirectiveLine($line, \SplFileObject $file, $lineBreaks)
    {
        $directive = new Directive();

        $args = $this->directiveRegex($line);
        $name = array_shift($args);

        if ($name === null) {
            $lineNum = $file->key();
            throw new SyntaxException($lineNum, $line, "Could not parse the name of the directive");
        }

        $directive->setName($name)
                  ->setArguments($args)
                  ->setLineBreaks($lineBreaks);

        return $directive;
    }
1239355
public function parseLine($line) {

        $data = explode(";", $line);
        $i    = -1;

        $model = new User();
        $model->setUserNumber(IntegerHelper::parseString($data[++$i]));
        $model->setCustomerNumber(IntegerHelper::parseString($data[++$i]));
        $model->setTitle($this->decodeString($data[++$i]));
        $model->setSurname($this->decodeString($data[++$i]));
        $model->setFirstname($this->decodeString($data[++$i]));
        $model->setDateBirth($this->decodeDate($data[++$i]));
        $model->setParkingSpace($this->decodeString($data[++$i]));
        $model->setRemarks($this->decodeString($data[++$i]));
        $model->setDatetimeLastModification($this->decodeDateTime($data[++$i]));
        $model->setDeletedRecord(BooleanHelper::parseString($data[++$i]));
        $model->setIdentificationNumber($this->decodeString($data[++$i]));
        $model->setCheckLicensePlate(BooleanHelper::parseString($data[++$i]));
        $model->setPassageLicensePlatePermitted(BooleanHelper::parseString($data[++$i]));
        $model->setExcessTimesCreditCard(BooleanHelper::parseString($data[++$i]));
        $model->setCreditCardNumber($this->decodeString($data[++$i]));
        $model->setExpiryDate($this->decodeDate($data[++$i]));
        $model->setRemarks2($this->decodeString($data[++$i]));
        $model->setRemarks3($this->decodeString($data[++$i]));
        $model->setDivision($this->decodeString($data[++$i]));
        $model->setEmail($this->decodeString($data[++$i]));
        $model->setGroupCounting(BooleanHelper::parseString($data[++$i]));
        $model->setETicketTypeP(IntegerHelper::parseString($data[++$i]));
        $model->setETicketEmailTelephone($this->decodeString($data[++$i]));
        $model->setETicketAuthentication(IntegerHelper::parseString($data[++$i]));
        $model->setETicketServiceTyp(IntegerHelper::parseString($data[++$i]));
        $model->setETicketServiceArt(IntegerHelper::parseString($data[++$i]));

        return $model;
    }
133905
public function add($line)
    {
        if ($line == '' ||
            ($pair = $this->generateRulePair($line, [-1 => self::DIRECTIVE_USER_AGENT] + array_keys(self::SUB_DIRECTIVES))) === false) {
            return $this->append = false;
        }
        if ($pair[0] === self::DIRECTIVE_USER_AGENT) {
            return $this->set($pair[1]);
        }
        $this->append = false;
        $result = [];
        foreach ($this->current as $group) {
            $result[] = $this->handler[$group]->{self::SUB_DIRECTIVES[$pair[0]]}->add($pair[1]);
            $this->handler[$group]->count++;
        }
1343950
public function tokenize($state, $startLine, $endLine)
    {
        $rules = $this->ruler->getRules('');
        $len = count($rules);
        $line = $startLine;
        $hasEmptyLines = false;
        $maxNesting = $state->md->options->maxNesting;

        while ($line < $endLine) {
            $state->line = $line = $state->skipEmptyLines($line);
            if ($line >= $endLine) { break; }

            // Termination condition for nested calls.
            // Nested calls currently used for blockquotes & lists
            if ($state->sCount[$line] < $state->blkIndent) { break; }

            // If nesting level exceeded - skip tail to the end. That's not ordinary
            // situation and we should not care about content.
            if ($state->level >= $maxNesting) {
                $state->line = $endLine;
                break;
            }

            // Try all possible rules.
            // On success, rule should:
            //
            // - update `state.line`
            // - update `state.tokens`
            // - return true

            foreach ($rules as &$rule) {
                if( is_array($rule) )
                    $ok = $rule[0]->{$rule[1]}($state, $line, $endLine, false);
                else
                    $ok = $rule($state, $line, $endLine, false);
                if ($ok) { break; }
            }

            // set state.tight if we had an empty line before current tag
            // i.e. latest empty line should not count
            $state->tight = !$hasEmptyLines;

            // paragraph might "eat" one newline after it in nested lists
            if ($state->isEmpty($state->line - 1)) {
                $hasEmptyLines = true;
            }

            $line = $state->line;

            if ($line < $endLine && $state->isEmpty($line)) {
                $hasEmptyLines = true;
                $line++;
                $state->line = $line;
            }
        }
    }
397252
public static function firstLine(string $comment): string
    {
        $docLines = \preg_split('~\R~u', $comment);

        if (isset($docLines[1])) {
            return \trim($docLines[1], "/\t *");
        }

        return '';
    }
1128130
public function with($line)
    {
        if ($line instanceof Action) {
            $this->action($line->text, $line->url);
        } elseif (! $this->actionText) {
            $this->introLines[] = $this->formatLine($line);
        } else {
            $this->outroLines[] = $this->formatLine($line);
        }

        return $this;
    }
905226
public function setIndent($indent)
    {
        if (!$this->isNumber($indent)) {
            throw new ConfigException(ConfigException::MSG_INVALID_ARG, [
                                                                          '$indent',
                                                                          'integer'
                                                                      ]
            );
        }
        $this->indent = $indent;

        return $this;
    }
1059333
protected function include( Line$line ):self
	{
		$inclued= (new static($this->htsl,$this->buffer->goSide($line->pregGet('/(?<=\( ).*(?= \))/')),$this))->execute()->content??null;

		false===$this->indentation or $inclued= $this->insertIndentations($inclued);

		return $this->openNode(new StringNode($this,$line))->append($inclued);
	}
783722
public function setLines($lines) {
        if (!is_array($lines)) {
            throw new AutoGitIgnoreInvalidParameterException("$lines must be an array. Each value is one line");
        }
        if (current($lines) !== $this->startMarker) {
            array_unshift($lines, $this->startMarker);
        }
        if (end($lines) !== $this->endMarker) {
            $lines[] = $this->endMarker;
        }
        $this->autoLines = $lines;
        return $this;
    }
1201366
public function parseLine($line) {

        $data = explode(";", $line);
        $i    = -1;

        $model = new StartRecordFormat();
        $model->setVersionRecordStructure(IntegerHelper::parseString($data[++$i]));
        $model->setFacilityNumber(IntegerHelper::parseString($data[++$i]));
        $model->setDateFile($this->decodeDate($data[++$i]));
        $model->setNumberRecords(IntegerHelper::parseString($data[++$i]));
        $model->setCurrency($this->decodeString($data[++$i]));

        return $model;
    }
745802
public function setLine($line)
    {
        if ( ! is_string($line))
        {
            throw new InvalidArgumentException(
                'Expected a string, but got '.gettype($line)
            );
        }

        $this->line = $line;
    }
1341535
protected function defineSection( Line$line ):self
	{
		$node= new SectionNode($this,$line);

		$node->open();

		return $this->openNode($node);
	}
545201
public function _processInlineTags(&$tag, $first = FALSE)
    {
        $description = '';
        if (is_array($tag)) $tag = $tag[0];
        if (is_object($tag)) {
            if ($first) {
                $tags =& $tag->firstSentenceTags($this->_doclet);
            } else {
                $tags =& $tag->inlineTags($this->_doclet);
            }
            if ($tags) {
                foreach ($tags as $aTag) {
                    if ($aTag) {
                        $description .= $aTag->text($this->_doclet);
                    }
                }
            }

            return $this->_doclet->formatter->toFormattedText($description);
        }

        return NULL;
    }
1346837
protected function parseTagLine( Line$line ):self
	{
		$node= new TagNode($this,$line);

		$this->appendLine($node->open());

		$node->embed and $this->startEmbedding($node->embed);

		return $this->openNode($node);
	}