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
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -98,7 +98,7 @@ public function parse(TokenStream $stream, $names = [])
98
98
99
99
$node = $this->parseExpression();
100
100
if (!$stream->isEOF()) {
101
-
thrownewSyntaxError(sprintf('Unexpected token "%s" of value "%s"', $stream->current->type, $stream->current->value), $stream->current->cursor, $stream->getExpression());
101
+
thrownewSyntaxError(sprintf('Unexpected token "%s" of value "%s".', $stream->current->type, $stream->current->value), $stream->current->cursor, $stream->getExpression());
102
102
}
103
103
104
104
return$node;
@@ -194,13 +194,13 @@ public function parsePrimaryExpression()
194
194
default:
195
195
if ('(' === $this->stream->current->value) {
196
196
if (false === isset($this->functions[$token->value])) {
197
-
thrownewSyntaxError(sprintf('The function "%s" does not exist', $token->value), $token->cursor, $this->stream->getExpression(), $token->value, array_keys($this->functions));
197
+
thrownewSyntaxError(sprintf('The function "%s" does not exist.', $token->value), $token->cursor, $this->stream->getExpression(), $token->value, array_keys($this->functions));
if (!\in_array($token->value, $this->names, true)) {
203
-
thrownewSyntaxError(sprintf('Variable "%s" is not valid', $token->value), $token->cursor, $this->stream->getExpression(), $token->value, $this->names);
203
+
thrownewSyntaxError(sprintf('Variable "%s" is not valid.', $token->value), $token->cursor, $this->stream->getExpression(), $token->value, $this->names);
204
204
}
205
205
206
206
// is the name used in the compiled code different
@@ -226,7 +226,7 @@ public function parsePrimaryExpression()
thrownewSyntaxError(sprintf('Unexpected token "%s" of value "%s"', $token->type, $token->value), $token->cursor, $this->stream->getExpression());
229
+
thrownewSyntaxError(sprintf('Unexpected token "%s" of value "%s".', $token->type, $token->value), $token->cursor, $this->stream->getExpression());
230
230
}
231
231
}
232
232
@@ -288,7 +288,7 @@ public function parseHashExpression()
288
288
} else {
289
289
$current = $this->stream->current;
290
290
291
-
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());
291
+
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());
292
292
}
293
293
294
294
$this->stream->expect(Token::PUNCTUATION_TYPE, ':', 'A hash key must be followed by a colon (:)');
@@ -326,7 +326,7 @@ public function parsePostfixExpression($node)
326
326
// 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