/** * Parse this node. * Set passed arguments and any optional arguments not passed to their * defaults, then render the children of the mixin definition. * * @param Context $pcontext the context in which this node is parsed * @return array the parsed node */ public function parse($pcontext) { $mixin = $pcontext->getMixin($this->name); $context = new Context($pcontext); $context->content = $this->children; $argc = count($this->args); $count = 0; $args = ScriptFunction::extractArgs($this->args, FALSE, $context); list($arguments) = ScriptFunction::fill_parameters($mixin->args, $args, $context, $this); $context->setVariables($arguments); $children = []; foreach ($mixin->children as $child) { $child->parent = $this; $children = array_merge($children, $child->parse($context)); } // $context->merge(); return $children; }
/** * Returns the Script object for this variable. * * @param \PHPSass\Tree\Context $context of the variable * @return Literals\Literal the Script object for this variable */ public function evaluate($context) { return $context->getVariable($this->name); }