mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-19 05:46:41 +00:00
Merge branch '1.x' into 2.x
* 1.x: fixed Parser contract for some implementations
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
namespace Twig\TokenParser;
|
||||
|
||||
use Twig\Error\SyntaxError;
|
||||
use Twig\Node\Node;
|
||||
use Twig\Token;
|
||||
|
||||
/**
|
||||
@@ -35,7 +36,9 @@ final class ExtendsTokenParser extends AbstractTokenParser
|
||||
}
|
||||
$this->parser->setParent($this->parser->getExpressionParser()->parseExpression());
|
||||
|
||||
$stream->expect(/* Token::BLOCK_END_TYPE */ 3);
|
||||
$stream->expect(Token::BLOCK_END_TYPE);
|
||||
|
||||
return new Node();
|
||||
}
|
||||
|
||||
public function getTag()
|
||||
|
||||
@@ -14,6 +14,7 @@ namespace Twig\TokenParser;
|
||||
use Twig\Error\SyntaxError;
|
||||
use Twig\Node\BodyNode;
|
||||
use Twig\Node\MacroNode;
|
||||
use Twig\Node\Node;
|
||||
use Twig\Token;
|
||||
|
||||
/**
|
||||
@@ -47,6 +48,8 @@ final class MacroTokenParser extends AbstractTokenParser
|
||||
$stream->expect(/* Token::BLOCK_END_TYPE */ 3);
|
||||
|
||||
$this->parser->setMacro($name, new MacroNode($name, new BodyNode([$body]), $arguments, $lineno, $this->getTag()));
|
||||
|
||||
return new Node();
|
||||
}
|
||||
|
||||
public function decideBlockEnd(Token $token)
|
||||
|
||||
Reference in New Issue
Block a user