Re: rename T_PAAMAYIM_NEKUDOTAYIM to T_DOUBLE_COLON
| From: | Rasmus Lerdorf | Date: | Mon, 01 Nov 2010 20:50:07 +0000 |
| Subject: | Re: rename T_PAAMAYIM_NEKUDOTAYIM to T_DOUBLE_COLON | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-50064@lists.php.net to get a copy of this message | ||
On 11/1/10 1:47 PM, Felipe Pena wrote:
> 2010/11/1 Richard Lynch <ceo@l-i-e.com>
>
>> On Fri, October 29, 2010 7:47 pm, admin wrote:
>>> WTF is T_PAAMAYIM_NEKUDOTAYIM?
>>>
>>> This has to be THE most asked question by new php developers when they
>>> come across it. Can we please change the token name to T_DOUBLE_COLON
>>> so I don't have to hear about it constantly?
>>>
>>> Those that disagree don't do enough PHP support to know how often it
>>> is
>>> asked. it's worth it.
>>
>> -1
>>
>>
> Instead of renaming the token, I prefer to associate a literal string to
> each token, to have a legible error message, without the T_ being shown.
>
> For example, we could use in the Bison grammar file:
> %token T_PAAMAYIM_NEKUDOTAYIM "::"
>
> So that the error message become:
>
> $ sapi/cli/php -r '::'
> Parse error: syntax error, unexpected :: in Command line code on line 1
>
> Instead of the known "unexpected T_PAAMAYIM_NEKUDOTAYIM" one.
Years and years ago that was the intent. I didn't think there was a
clean way to do that in yacc though.
-Rasmus