You are here

private function HamlParser::buildTree in Sassy 7

* Builds a parse tree under the parent node. *

Parameters

HamlNode the parent node:

2 calls to HamlParser::buildTree()
HamlParser::addChildren in phamlp/haml/HamlParser.php
* Adds children to a node if the current line has children. *
HamlParser::toTree in phamlp/haml/HamlParser.php
* Parse Haml source into a document tree. *

File

phamlp/haml/HamlParser.php, line 471

Class

HamlParser
HamlParser class. Parses {@link http://haml-lang.com/ Haml} view files. @package PHamlP @subpackage Haml

Code

private function buildTree($parent) {
  while (!empty($this->source) && $this
    ->isChildOf($parent, $this->source[0])) {
    $line = $this
      ->getNextLine();
    if (!empty($line)) {
      $node = $this->inFilter ? new HamlNode($line[self::HAML_SOURCE], $parent) : $this
        ->parseLine($line, $parent);
      if (!empty($node)) {
        $node->token = $line;
        $node->showOutput = $this->showOutput;
        $node->showSource = $this->showSource;
        $this
          ->addChildren($node, $line);
      }
    }
  }
}