On 06/20/2011 08:50 AM, Derick Rethans wrote:
On Mon, 20 Jun 2011, Felipe Pena wrote:

2011/6/20 Etienne Kneuss<col...@php.net>

I'd love to see the proposal from Felipe about the improved parse
errors in that list. I believe that the patch was ready or almost
ready? I can't find the RFC though, but maybe the RFC never existed...


https://wiki.php.net/rfc/improved-parser-error-message

I think this is good and helpful.
I've two suggestions though:

- Add the token name in parenthesis at the end of the string
- Add '' around the token strings

Examples:
   Parse error: syntax error, unexpected '<<=' (T_SL_EQUAL) in Command line 
code on line 1
   Parse error: syntax error, unexpected '::' (T_PAAMAYIM_NEKUDOTAYIM) in 
Command line code on line 1
   Parse error: syntax error, unexpected 'quoted-string' 
(T_CONSTANT_ENCAPSED_STRING), expecting identifier or '(' in Command line code 
on line 1

And we need to make sure to check for escaped<  and>  in HTML error
messages :)

cheers,
Derick


Having the script token text is a good idea.

If messages are changing, can we feasibly strip the Bison "syntax
error, " component?  The "Command line code" component is arguably
useless too.  Or at least it could be lower cased to "command line",
though changing this in php_cli.c may have an unwanted cascading
effect (?)

An example message:

   Parse error: unexpected 'quoted-string' (T_CONSTANT_ENCAPSED_STRING), 
expecting identifier or '(' on line 1

Chris

--
Email: christopher.jo...@oracle.com
Tel:  +1 650 506 8630
Blog:  http://blogs.oracle.com/opal/

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to