public function setMacro($name, Twig_Node_Macro $node) { if ($this->isReservedMacroName($name)) { throw new Twig_Error_Syntax(sprintf('"%s" cannot be used as a macro name as it is a reserved keyword.', $name), $node->getTemplateLine(), $this->stream->getSourceContext()->getName()); } $this->macros[$name] = $node; }