> Am 07.09.2015 um 02:59 schrieb Sara Golemon <p...@golemon.com>:
> 
> On Sep 6, 2015, at 07:01, Bob Weinand <bobw...@hotmail.com> wrote:
>> Also, Hack is using a completely different parser, doesn't look like we 
>> could borrow anything there.
>> 
> True, Hack's parser is ocaml based and unrecognizable to the majority of this 
> list.  But HHVM's parser (which implements the runtime side of Hack), is a 
> flex/bison parser, not just similar to, but actually directly descended from 
> PHP 5.2's parser.  Sure things have diverged since then, but the overall rule 
> structure is nearly identical in spirit.  Borrowing concepts should be 
> trivial.
> 
> -Sara

Oh, I thought that feature to be Hack-only. Looks like I'm wrong and hence 
looked at the wrong place. [I always heard Hack has short Closures, but never 
was told HHVM had them too...]

But as I see you use a T_LAMBDA_OP which is inserted by a token-pre-parser 
before it's being analyzed by the real parser. Wouldn't say we really could 
compare that. It's a lot of complication... If I remember correctly, we had a 
similar reason back then to reject my initial keywords as identifiers patch as 
it was using that type of approach.
Honestly, a %glr-parser bison directive would look cleaner here. But I'm not 
sure if we want to go that route down as a LALR(1) has much more deterministic 
performance characteristics...

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

Reply via email to