Gregwar\RST\Parser::parseLines PHP Method

parseLines() protected method

Process all the lines of a document string
protected parseLines ( string $document )
$document string the string (content) of the document
    protected function parseLines($document)
    {
        // Including files
        $document = str_replace("\r\n", "\n", $document);
        $document = "\n{$document}\n";
        $document = $this->includeFiles($document);
        // Removing UTF-8 BOM
        $bom = "";
        $document = str_replace($bom, '', $document);
        $lines = explode("\n", $document);
        $this->state = self::STATE_BEGIN;
        foreach ($lines as $n => $line) {
            $this->currentLine = $n;
            while (!$this->parseLine($line)) {
            }
        }
        // Document is flushed twice to trigger the directives
        $this->flush();
        $this->flush();
    }