Skip to content

Commit d270d79

Browse files
committed
Improve output of tokens in Parse Errors
Currently, unexpected tokens in the parser are shown as the text found, plus the internal token name, including the notorious "unexpected '::' (T_PAAMAYIM_NEKUDOTAYIM)". This commit replaces that with a more user-friendly format, with two types of token: * Tokens which always represent the same text are shown like "unexpected token '::'" and "expected '::'" * Tokens which have variable text are given a user-friendly name, and show like "unexpected identifier 'foo'", and "expected identifer". As a special-case, quoted strings are not quoted an extra time, so show like "unexpected quoted string 'foo'" rather than ''foo''.
1 parent 7e94082 commit d270d79

File tree

1 file changed

+226
-175
lines changed

1 file changed

+226
-175
lines changed

0 commit comments

Comments
 (0)