Hello,

On Tue, Jun 21, 2011 at 05:17, Rasmus Lerdorf <syst...@php.net> wrote:
> On 06/20/2011 08:09 PM, Felipe Pena wrote:
>
>> I'm ok with this, I just think it's ugly to repeat the token name in
>> the definition in the .y file. :P
>>
>> %token T_LNUMBER "'number' (T_LNUMBER)"
>> %token T_STRING "'identifier' (T_STRING)"
>
> Why 'identifier' and not 'string' or 'string-literal' there?

For people using php, a string or a string literal is "foo" or 'foo'.
T_STRING does not represent "foo" nor 'foo'.
identifier seems to adequatly describe what it encompass.

IMHO, it would even be better if the unnexpect part displayed the
actual content:

i.e.

function 1() => Unexpected number '1' ...
or
function 1() => Unexpected '1'...

Best,

> People know
> what a string is. I am not sure that people know what an identifier is,
> so in this case changing the error message from something that says
> "expecting T_STRING" to "expecting identifier" isn't making the error
> message any clearer as far as I am concerned. This is one of the reasons
> that having the token name there is useful. It provides continuity with
> the current error messages that people have grown used to. I think we
> either need the token names, or we need more descriptive names printed.
>
> -Rasmus
>



-- 
Etienne Kneuss
http://www.colder.ch

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

Reply via email to