@param string $line

@return string
765228
private function escapeFirstCharacters($line)
    {
        $escapable = array('>', '- ', '+ ', '--', '~~~', '---', '- - -');

        foreach ($escapable as $i)
        {
            if (strpos(ltrim($line), $i) === 0)
            {
                // Found a character that must be escaped, adding a backslash before
                return '\\' . ltrim($line);
            }
        }

        return $line;
    }
515927
protected function parseExpressionHtmlLine( Line$line ):self
	{
		$content=  $line->slice(1);

		return $this->openNode(new StringNode($this,$line))->appendLine("<?$content?>");
	}
215139
protected function parse_line($line) {
        $data = array();
        foreach ($line as $keynum => $value) {
            if (!isset($this->columns[$keynum])) {
                // This should not happen.
                continue;
            }

            $key = $this->columns[$keynum];
            $data[$key] = $value;
        }
        return $data;
    }
597723
public function parseTableSeparatorLine(string $line) : ?TableSeparatorLineConfig
    {
        $header = false;
        $pretty = false;
        $line   = trim($line);

        if ($line === '') {
            return null;
        }

        // Finds the table chars
        $chars = $this->findTableChars($line);

        if ($chars === null) {
            return null;
        }

        if ($chars[0] === self::PRETTY_TABLE_JOINT && $chars[1] === self::PRETTY_TABLE_LETTER) {
            $pretty = true;
            // reverse the chars: - is the line char, + is the space char
            $chars = [self::PRETTY_TABLE_LETTER, self::PRETTY_TABLE_JOINT];
        } elseif ($chars[0] === self::PRETTY_TABLE_JOINT && $chars[1] === self::PRETTY_TABLE_HEADER) {
            $pretty = true;
            $header = true;
            // reverse the chars: = is the line char, + is the space char
            $chars = [self::PRETTY_TABLE_HEADER, self::PRETTY_TABLE_JOINT];
        } else {
            // either a simple table or not a separator line

            // if line char is not "=" or "-", not a separator line
            if (! in_array($chars[0], [self::SIMPLE_TABLE_LETTER, self::SIMPLE_TABLE_LETTER_ALT], true)) {
                return null;
            }

            // if space char is not a space, not a separator line
            if ($chars[1] !== ' ') {
                return null;
            }
        }

        $parts = [];
        /** @var int|null $currentPartStart */
        $currentPartStart = null;

        $i = 0;
        for ($i = 0; $i < strlen($line); $i++) {
            // we found the "line char": "-" or "="
            if ($line[$i] === $chars[0]) {
                if ($currentPartStart === null) {
                    $currentPartStart = $i;
                }

                continue;
            }

            if ($line[$i] !== $chars[1]) {
                throw new Exception(sprintf('Unexpected char "%s"', $line[$i]));
            }

            // found the "space" char
            // record the part "range" if we're at the end of a range
            if ($currentPartStart === null) {
                continue;
            }

            $parts[]          = [$currentPartStart, $i];
            $currentPartStart = null;
        }

        // finish the last "part"
        if ($currentPartStart !== null) {
            $parts[] = [$currentPartStart, $i];
        }

        if (count($parts) > 1) {
            return new TableSeparatorLineConfig(
                $header,
                $pretty ? TableNode::TYPE_PRETTY : TableNode::TYPE_SIMPLE,
                $parts,
                $chars[0],
                $line
            );
        }

        return null;
    }
1232206
public function parseName($line)
    {
        $matches = [];
        $pattern = '/^\*\s+remote\s+(.*)$/';
        preg_match($pattern, trim($line), $matches);
        if (!isset($matches[1])) {
            return '';
        }

        return $matches[1];
    }
995463
public function close( Line$closerLine ):string
	{
		if( isset($this->config['close_by']) && $closerLine->indentLevel==$this->line->indentLevel ){
			foreach( $this->config['close_by'] as $key=>$value ){
				if( $closerLine->pregMatch($key) ){
					return $this->withParam($value);
				}
			}
		}

		if( isset($this->config['closer']) )
			{ return $this->withParam($this->config['closer']); }

		return '';
	}
379055
protected function extractElements($line)
    {
        $elements = [];
        $buffer   = '';
        $quote    = false;

        foreach (\str_split($line) as $character)
        {
            if (\in_array($character, ['\'', '"']))
            {
                $quote = ! $quote;

                continue;
            }

            if ((':' == $character) and ! $quote)
            {
                $elements[] = $buffer;

                $buffer = '';

                continue;
            }

            $buffer .= $character;
        }

        if ($buffer)
        {
            $elements[] = $buffer;
        }

        return $elements;
    }
670604
public function write($line)
    {
        return $this->pipes !== null ? fwrite($this->pipes[0], $line . PHP_EOL) : false;
    }
1363070
protected function parseStringLine( Line$line ):self
	{
		return $this->openNode(new StringNode($this,$line))->appendLine($this->htmlEntities(trim($line->getContent())));
	}
1259273
public function parse($line)
    {
        $object = new \stdClass();

        $object->type = 'info';
        $object->message = $line;

        return $object;
    }
334193
public function parseGitAttributesLine($line)
    {
        $parts = preg_split('#\s+#', $line);

        if (count($parts) != 2) {
            return null;
        }

        if ($parts[1] === 'export-ignore') {
            return $this->generatePattern($parts[0]);
        }
    }
772289
protected function parseLine( $line )
	{
		$data	= preg_replace_callback( $this->patterns, array( $this, 'callback' ), $line );
		return unserialize( $data );
	}
1036389
protected function parseLine(string $line): string
    {
        if (!$this->isHiraganaCodePoints($line)) {
            throw new SyntaxException(_('ピクトセンスで使用可能の文字はひらがな、「ヴ」「ー」のみです。ただし、「ゔ」「ゕ」「ゖ」「𛀁」も使用できません: ') . $line);
        }
        
        if (mb_strlen($line, 'UTF-8') > self::WORD_MAX) {
            throw new SyntaxException(sprintf(_('「%1$s」は%2$d文字を越えています。'), $line, self::WORDS_MAX));
        }

        return str_replace('ヴ', 'ゔ', $line);
    }
791214
protected function parseExpressionLine( Line$line ):self
	{
		$content=  $line->slice(1);
		$ent_flag= var_export($this->htsl->getConfig('ENT_flags',$this->docType),true);
		$charset=   var_export($this->htsl->getConfig('charset'),true);

		return $this->openNode(new StringNode($this,$line))->appendLine("<?=htmlentities($content,$ent_flag,$charset,false)?>");
	}
619772
public function line($line = '', $params = null)
    {
        if (empty($params)) {
            return parent::line($line);
        }

        //  We have some parameters, sub 'em in or the unicorns will die.
        $line = parent::line($line);

        if ($line !== false) {

            if (is_array($params)) {

                $line = vsprintf($line, $params);

            } else {

                $line = sprintf($line, $params);
            }
        }

        return $line;
    }
52473
public static function dumpInline(string $inline): string
    {
        if (false === strpos($inline, '"')) {
            return '"' . $inline . '"';
        }
        if (false === strpos($inline, "'")) {
            return "'$inline'";
        }
        return "<$inline>";
    }
942309
private function parseCsv($line): array
    {
        return str_getcsv(
            $line,
            $this->conversion['delimiter'],
            $this->conversion['enclosure'],
            $this->conversion['escape']
        );
    }