On 22.02.2008, at 06:56, Gregory Beaver wrote:
Another detail: The implementation of the parser changes should still

allow a class or function called "trait", i.e. "trait" should only be a
keyword at specific positions in the source to avoid unneccesary BC
breaks. The current patch has this BC problem.

This is not possible to implement, having tried to do a similar thing
for 'import' and 'namespace.'  The reason is that we can encounter a
classname at any point thanks to "classname::whatever" syntax, so it
slows the lexer down a bit in that for every T_TRAIT we would have to
check to see if the next 2 characters are ::, and makes the lexer
uber-complicated.  It's a big mess.

Not yet at any rate. From what I hear the next step after migration to re2c [1] is to migrate to lemon, which should make stuff like this possible. However while re2c has a chance of making it into PHP 5.3, the lemon part seems a bit further off.

regards,
Lukas

[1] http://blog.somabo.de/2008/02/php-on-re2c.html

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

Reply via email to