private function HamlParser::parseElement in Sassy 7
* Parse an element. *
Parameters
array line to parse: * @param HamlNode parent node * @return HamlElementNode tag node and children
1 call to HamlParser::parseElement()
- HamlParser::parseLine in phamlp/
haml/ HamlParser.php - * Parse a line of Haml into a HamlNode for the document tree *
File
- phamlp/
haml/ HamlParser.php, line 1186
Class
- HamlParser
- HamlParser class. Parses {@link http://haml-lang.com/ Haml} view files. @package PHamlP @subpackage Haml
Code
private function parseElement($line, $parent) {
$node = new HamlElementNode($line[self::HAML_TAG], $parent);
$node->isSelfClosing = $this
->isSelfClosing($line);
$node->isBlock = $this
->isBlock($line);
$node->attributes = $this
->parseAttributes($line);
if ($this
->hasContent($line)) {
$child = $this
->parseContent($line, $node);
$child->showOutput = $this->showOutput;
$child->showSource = $this->showSource;
$child->token = array(
self::HAML_SOURCE => $line[self::HAML_SOURCE],
'filename' => $line['filename'],
'line' => $line['line'],
'level' => $line['level'] + 1,
);
}
$node->whitespaceControl = $this
->parseWhitespaceControl($line);
return $node;
}