Re: [RFC] [Vote] Keywords as identifiers
| From: | Bob Weinand | Date: | Tue, 22 Oct 2013 09:52:45 +0000 |
| Subject: | Re: [RFC] [Vote] Keywords as identifiers | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-69748@lists.php.net to get a copy of this message | ||
Am 22.10.2013 um 11:30 schrieb Pierre Joye <pierre.php@gmail.com>:
> On Tue, Oct 22, 2013 at 11:11 AM, Derick Rethans <derick@php.net> wrote:
>> On Mon, 21 Oct 2013, Bob Weinand wrote:
>>> I have started the vote for extended keyword support RFC:
>>>
>>> https://wiki.php.net/rfc/keywords_as_identifiers
>>
>> Just to explain why I voted "no". I think the idea is good, but what I
>> see from the patch is that it adds a *lot* of hand written state
>> machines which are going to be a pain to maintain. I do not think this
>> extra maintenance is worth the features - we've done pretty well without
>> it.
>
> I did not vote yet, however I agree with Derick. A cleaner solution
> would be better. We have lived with this restriction for some time
> already and we may as well delay this RFC until we have a viable
> technical solution. If anyone feels motivated enough to implement the
> parser/lexer using other tools :)
>
>
> --
> Pierre
>
> @pierrejoye | http://www.libgd.org
Thank you for the feedback,
I actually don't think that it would be hard to maintain as it still is only a
limited set of keywords where extra conditions are necessary.
You rarely should have to change the implementation.
If anyone has an idea how I could just write in the parser:
"T_STRING or (alphabetic keyword with lowest precedence)"
then that'd be very welcome, but I didn't actually find a solution for that
without a lot of reduce/reduce conflicts.
See also that initial implementation which just involved parser,
but had more limited keyword support:
https://github.com/bwoebi/php-src/commit/18c78af2d9ff27cf2df3ad0e63f5c4cce11a5db3
Bob Weinand