public function SassIfNode::parse in Sassy 7
Same name and namespace in other branches
- 7.3 phpsass/tree/SassIfNode.php \SassIfNode::parse()
* Parse this node. *
Parameters
SassContext the context in which this node is parsed: * @return array parsed child nodes
File
- phamlp/
sass/ tree/ SassIfNode.php, line 74
Class
- SassIfNode
- SassIfNode class. Represents Sass If, Else If and Else statements. Else If and Else statement nodes are chained below the If statement node. @package PHamlP @subpackage Sass.tree
Code
public function parse($context) {
if ($this
->isElse() || $this
->evaluate($this->expression, $context)
->toBoolean()) {
$children = $this
->parseChildren($context);
}
elseif (!empty($this->else)) {
$children = $this->else
->parse($context);
}
else {
$children = array();
}
return $children;
}