30 $stream = $this->parser->getStream();
32 if ($this->parser->hasBlock(
$name)) {
36 $this->parser->pushLocalScope();
37 $this->parser->pushBlockStack(
$name);
40 $body = $this->parser->subparse(array($this,
'decideBlockEnd'),
true);
44 if ($value !=
$name) {
50 new Twig_Node_Print($this->parser->getExpressionParser()->parseExpression(), $lineno),
55 $block->setNode(
'body', $body);
56 $this->parser->popBlockStack();
57 $this->parser->popLocalScope();
64 return $token->
test(
'endblock');
73class_alias(
'Twig_TokenParser_Block',
'Twig\TokenParser\BlockTokenParser',
false);
sprintf('%.4f', $callTime)
An exception for terminatinating execution or to throw for unit testing.
Exception thrown when a syntax error occurs during lexing or parsing of a template.
Represents a block call node.
Represents a node that outputs an expression.
Represents a node in the AST.
Marks a section of a template as being reusable.
getTag()
Gets the tag name associated with this token parser.
parse(Twig_Token $token)
Parses a token and returns a node.
decideBlockEnd(Twig_Token $token)
Base class for all token parsers.
test($type, $values=null)
Tests the current token for a type and/or a value.
$stream
PHP stream implementation.