mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-05 06:56:51 +00:00
Added token type and value to error message
Added the given token type and value to the error message in case that the token after '.' is neither a name nor a number.
This commit is contained in:
committed by
Fabien Potencier
parent
65bedae131
commit
6c8da65b74
@@ -488,7 +488,7 @@ class ExpressionParser
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new SyntaxError('Expected name or number.', $lineno, $stream->getSourceContext());
|
throw new SyntaxError(sprintf('Expected name or number, got value "%s" of type %s.', $token->getValue(), Token::typeToEnglish($token->getType())), $lineno, $stream->getSourceContext());
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($node instanceof NameExpression && null !== $this->parser->getImportedSymbol('template', $node->getAttribute('name'))) {
|
if ($node instanceof NameExpression && null !== $this->parser->getImportedSymbol('template', $node->getAttribute('name'))) {
|
||||||
|
|||||||
Reference in New Issue
Block a user