You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Parser.php
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -99,7 +99,7 @@ public function parse(TokenStream $stream, $names = array())
99
99
100
100
$node = $this->parseExpression();
101
101
if (!$stream->isEOF()) {
102
-
thrownewSyntaxError(sprintf('Unexpected token "%s" of value "%s"', $stream->current->type, $stream->current->value), $stream->current->cursor);
102
+
thrownewSyntaxError(sprintf('Unexpected token "%s" of value "%s"', $stream->current->type, $stream->current->value), $stream->current->cursor, $stream->getExpression());
103
103
}
104
104
105
105
return$node;
@@ -195,13 +195,13 @@ public function parsePrimaryExpression()
195
195
default:
196
196
if ('(' === $this->stream->current->value) {
197
197
if (false === isset($this->functions[$token->value])) {
198
-
thrownewSyntaxError(sprintf('The function "%s" does not exist', $token->value), $token->cursor);
198
+
thrownewSyntaxError(sprintf('The function "%s" does not exist', $token->value), $token->cursor, $this->stream->getExpression());
thrownewSyntaxError(sprintf('Unexpected token "%s" of value "%s"', $token->type, $token->value), $token->cursor);
230
+
thrownewSyntaxError(sprintf('Unexpected token "%s" of value "%s"', $token->type, $token->value), $token->cursor, $this->stream->getExpression());
231
231
}
232
232
}
233
233
@@ -289,7 +289,7 @@ public function parseHashExpression()
289
289
} else {
290
290
$current = $this->stream->current;
291
291
292
-
thrownewSyntaxError(sprintf('A hash key must be a quoted string, a number, a name, or an expression enclosed in parentheses (unexpected token "%s" of value "%s"', $current->type, $current->value), $current->cursor);
292
+
thrownewSyntaxError(sprintf('A hash key must be a quoted string, a number, a name, or an expression enclosed in parentheses (unexpected token "%s" of value "%s"', $current->type, $current->value), $current->cursor, $this->stream->getExpression());
293
293
}
294
294
295
295
$this->stream->expect(Token::PUNCTUATION_TYPE, ':', 'A hash key must be followed by a colon (:)');
@@ -327,7 +327,7 @@ public function parsePostfixExpression($node)
327
327
// As a result, if $token is NOT an operator OR $token->value is NOT a valid property or method name, an exception shall be thrown.
0 commit comments