protected function renderChildrenHaml(HamlNode $node) { $parent = $node->getParent(); $haml = $parent !== null ? $parent->getSpaces() . $node->getHaml() : $node->getRawHaml(); $output = $haml . "\n"; if ($node->hasChildren()) { $children = $node->getChildren(); for ($i = 0, $count = count($children); $i < $count; ++$i) { $output .= $this->renderChildrenHaml($children[$i]); } } return $output; }