Re: [RFC] 5.4 features for vote (long)
| From: | Felipe Pena | Date: | Tue, 21 Jun 2011 11:13:39 +0000 |
| Subject: | Re: [RFC] 5.4 features for vote (long) | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-53476@lists.php.net to get a copy of this message | ||
2011/6/21 Etienne Kneuss <colder@php.net>:
> Hello,
>
> On Tue, Jun 21, 2011 at 05:17, Rasmus Lerdorf <systems@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'...
>
Currently it's possible to do this, it'll only require a static
variable in yytnamerr implementation.
--
Regards,
Felipe Pena