mirror of
https://github.com/twigphp/Twig.git
synced 2026-08-31 04:27:00 +00:00
fixed wrong error message on "import" and "from"
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
* 1.41.1 (2019-XX-XX)
|
||||
|
||||
* n/a
|
||||
* fixed wrong error message on "import" and "from"
|
||||
|
||||
* 1.41.0 (2019-05-14)
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ class FromTokenParser extends AbstractTokenParser
|
||||
{
|
||||
$macro = $this->parser->getExpressionParser()->parseExpression();
|
||||
$stream = $this->parser->getStream();
|
||||
$stream->expect('import');
|
||||
$stream->expect(Token::NAME_TYPE, 'import');
|
||||
|
||||
$targets = [];
|
||||
do {
|
||||
|
||||
@@ -27,7 +27,7 @@ class ImportTokenParser extends AbstractTokenParser
|
||||
public function parse(Token $token)
|
||||
{
|
||||
$macro = $this->parser->getExpressionParser()->parseExpression();
|
||||
$this->parser->getStream()->expect('as');
|
||||
$this->parser->getStream()->expect(Token::NAME_TYPE, 'as');
|
||||
$var = new AssignNameExpression($this->parser->getStream()->expect(Token::NAME_TYPE)->getValue(), $token->getLine());
|
||||
$this->parser->getStream()->expect(Token::BLOCK_END_TYPE);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user