atom feed23 messages in net.php.lists.internalsRe: [PHP-DEV] Re: [RFC] Improved pars...
FromSent OnAttachments
Felipe PenaMay 16, 2011 5:15 am 
Ferenc KovacsMay 16, 2011 5:30 am 
Felipe PenaMay 16, 2011 5:46 am 
Etienne KneussMay 16, 2011 7:33 am 
Pierrick CharronMay 16, 2011 7:36 am 
Florian AnderiaschMay 16, 2011 10:52 am 
Julien PauliMay 17, 2011 3:31 am 
Felipe PenaMay 17, 2011 7:18 am 
Andi GutmansMay 17, 2011 9:01 am 
Gustavo LopesMay 17, 2011 9:07 am 
Derick RethansMay 17, 2011 9:09 am 
Gustavo LopesMay 17, 2011 9:10 am 
Zeev SuraskiMay 17, 2011 9:13 am 
Ferenc KovacsMay 17, 2011 9:31 am 
Stas MalyshevMay 17, 2011 9:49 am 
Ferenc KovacsMay 17, 2011 9:58 am 
Rasmus LerdorfMay 17, 2011 10:01 am 
Gustavo LopesMay 18, 2011 1:42 am 
Felipe PenaJun 23, 2011 11:08 am 
Jordi BoggianoJun 23, 2011 11:16 am 
Stas MalyshevJun 23, 2011 11:16 am 
Paul DragoonisJun 23, 2011 11:21 am 
Sebastian BergmannJul 18, 2011 2:53 am 
Subject:Re: [PHP-DEV] Re: [RFC] Improved parser error message
From:Jordi Boggiano (j.bo@seld.be)
Date:Jun 23, 2011 11:16:12 am
List:net.php.lists.internals

Thanks for the great work. More should be done on the front of helping newcomers solve trivial issues imo.

On 23.06.2011 20:08, Felipe Pena wrote:

$ sapi/cli/php -r 'class ' Current: Parse error: syntax error, unexpected $end, expecting T_STRING

Patched: Parse error: syntax error, unexpected end of file, expecting 'identifier' (T_STRING)

identifier should not be quoted. The quotes are fine for "expecting '{'" and "unexpected 'foo'" because those are text literals, but this implies you were supposed to actually type "class identifier", which is obviously not the intended message.

$ sapi/cli/php -r 'class abc foo' Current: Parse error: syntax error, unexpected T_STRING, expecting '{' in Command line code on line 1

Patched: Parse error: syntax error, unexpected 'foo' (T_STRING), expecting '{' in Command line code on line 1

As can be noticed, I added the actual scanned string in the "unexpected" part. This might be useful for finding really which makes the parser error. (It was a bit tricky though :D)

Good stuff, maybe "unexpected string 'foo' (T_STRING)" or "unexpected string (T_STRING) 'foo'" would be more clear, but no big deal really.

Cheers