Changes:
+ * added support for macro name in the endmacro tag
* fixed the "length" filter for numbers
* removed coupling between Twig_Node and Twig_Template
* fixed the ternary operator precedence rule
$this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE);
$this->parser->pushLocalScope();
$body = $this->parser->subparse(array($this, 'decideBlockEnd'), true);
+ if ($this->parser->getStream()->test(Twig_Token::NAME_TYPE)) {
+ $value = $this->parser->getStream()->next()->getValue();
+
+ if ($value != $name) {
+ throw new Twig_Error_Syntax(sprintf("Expected endmacro for macro '$name' (but %s given)", $value), $lineno);
+ }
+ }
$this->parser->popLocalScope();
$this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE);