getLine(); $name = $this->parser->getStream()->expect(Twig_Token::NAME_TYPE)->getValue(); $arguments = $this->parser->getExpressionParser()->parseArguments(); $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); $body = $this->parser->subparse(array($this, 'decideBlockEnd'), true); $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); $this->parser->setMacro($name, new Twig_Node_Macro($name, $body, $arguments, $lineno, $this->getTag())); return null; } public function decideBlockEnd($token) { return $token->test('endmacro'); } /** * Gets the tag name associated with this token parser. * * @param string The tag name */ public function getTag() { return 'macro'; } }