Re: [RFC] Improved parser error message
| From: | Pierrick Charron | Date: | Mon, 16 May 2011 14:36:52 +0000 |
| Subject: | Re: [RFC] Improved parser error message | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-52395@lists.php.net to get a copy of this message | ||
+1
Regards
Pierrick
On 16 May 2011 08:15, Felipe Pena <felipensp@gmail.com> wrote:
> Hi all,
> As I have proposed previously in an old thread... What about we name all
> the
> tokens to have an improved parser error message? (i.e. anymore
> T_PAAMAYIM_NEKUDOTAYIM, T_DOLLAR_OPEN_CURLY_BRACES in the messages etc)
>
> Some examples:
>
> $ sapi/cli/php -r 'function ""'
> Patched:
> Parse error: syntax error, unexpected quoted-string, expecting identifier
> or
> '(' in Command line code on line 1
>
> Current:
> Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting
> T_STRING or '(' in Command line code on line 1
>
>
> $ sapi/cli/php -r 'echo ::a;'
> Patched:
> Parse error: syntax error, unexpected :: in Command line code on line 1
>
> Current:
> Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in Command
> line
> code on line 1
>
> Other examples and patch at:
> https://wiki.php.net/rfc/improved-parser-error-message
>
> Any thoughts?
>
> Thanks.
>
> --
> Regards,
> Felipe Pena
>