You are here

public function SassEachNode::parse in Sassy 7

Same name and namespace in other branches
  1. 7.3 phpsass/tree/SassEachNode.php \SassEachNode::parse()

* Parse this node. *

Parameters

SassContext the context in which this node is parsed: * @return array parsed child nodes

File

phamlp/sass/tree/SassEachNode.php, line 59

Class

SassEachNode
SassEachNode class. Represents a Sass @each loop. @package PHamlP @subpackage Sass.tree

Code

public function parse($context) {
  $children = array();
  $context = new SassContext($context);
  foreach (explode(',', $this
    ->evaluate($this->in, $context)->value) as $var) {
    $context
      ->setVariable($this->variable, new SassString(trim($var)));
    $children = array_merge($children, $this
      ->parseChildren($context));
  }
  return $children;
}