On 31 May 2017 14:48:03 BST, Levi Morrison <le...@php.net> wrote:
>On Wed, May 31, 2017 at 7:36 AM, Rowan Collins
><rowan.coll...@gmail.com> wrote:
>> I was just pondering alternative approaches to stop the => token
>being ambiguous, and wondered if surrounding the whole expression with
>braces could work:
>>
>> { => $bound * 2 }
>> { $a, $b => $a * $b }
>
>This does not work. We permit expressions as statements and we also
>allow empty blocks:
>
>    {
>        $a = $foo;
>    }
>
>These will conflict in the grammar.

Yeah, I wondered if that would be the case, but don't know enough about how 
parsers work to be sure one way or the other. It's not ambiguous, because the 
=> wouldn't be legal there, but I guess it's "too late" by the time that token 
is reached. :(

Regards,

-- 
Rowan Collins
[IMSoP]

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

Reply via email to