mirror of
https://github.com/twigphp/Twig.git
synced 2026-10-08 04:45:47 +00:00
improved error messages
This commit is contained in:
committed by
Fabien Potencier
parent
4c237b2253
commit
024b9367eb
@@ -344,7 +344,7 @@ class Twig_ExpressionParser
|
||||
while (true) {
|
||||
$token = $this->parser->getStream()->expect(Twig_Token::NAME_TYPE, null, 'Only variables can be assigned to');
|
||||
if (in_array($token->getValue(), array('true', 'false', 'none'))) {
|
||||
throw new Twig_Error_Syntax($token->getValue() . ' cannot be assigned to');
|
||||
throw new Twig_Error_Syntax(sprintf('You cannot assign a value to "%s"', $token->getValue()));
|
||||
}
|
||||
$targets[] = new Twig_Node_Expression_AssignName($token->getValue(), $token->getLine());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user