33 $stream = $this->parser->getStream();
36 $arguments = $this->parser->getExpressionParser()->parseArguments(
true,
true);
39 $this->parser->pushLocalScope();
40 $body = $this->parser->subparse(array($this,
'decideBlockEnd'),
true);
42 $value = $stream->next()->getValue();
44 if ($value != $name) {
45 throw new Twig_Error_Syntax(sprintf(
"Expected endmacro for macro '$name' (but %s given)", $value), $stream->getCurrent()->getLine(), $stream->getFilename());
48 $this->parser->popLocalScope();
56 return $token->
test(
'endmacro');
decideBlockEnd(Twig_Token $token)
Base class for all token parsers.
Exception thrown when a syntax error occurs during lexing or parsing of a template.
test($type, $values=null)
Tests the current token for a type and/or a value.
getTag()
Gets the tag name associated with this token parser.
parse(Twig_Token $token)
Parses a token and returns a node.