Re: [RFC] Keywords as identifiers

From: Date: Wed, 18 Sep 2013 12:58:39 +0000
Subject: Re: [RFC] Keywords as identifiers
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
Am 18.09.2013 um 14:30 schrieb "Nicolas Grekas" <[email protected]>:

> Hi Bob, thanks for the RFC!
> 
> For those of us that use token_get_all(), will the newly allowed token
> appear as T_STRING or as T_%KEYWORD%?
> May I suggest you add a word about it in the RFC?
> 
> As Ryan pointed out in the other thread, a T_%KEYWORD% has a high chance to
> break existing documentation generators or code parsers.
> 
> As Nikita remembered us, "default" in $a->default is emitted as a T_STRING..
> It might be consistent to also emit a T_STRING on the new cases that you
> plan to allow?
> 
> Regards,
> Nicolas

Absolutely true; this will still emit a keyword token.
The reason is some limitation of the lexer which allows me to switch to a mode after I have
encountered for example a :: (e.g. lookbehind), but it doesn't allow me lookaheads.

If you have an idea how to circumwent that; I'm open to any suggestions.

Bob Weinand


Thread (15 messages)

« previous php.internals (#69190) next »