Generator Arrow Functions

Waldemar Horwat waldemar at google.com
Tue Nov 26 15:07:13 PST 2013


On 11/26/2013 03:00 PM, André Bargull wrote:
>> On 11/26/2013 02:28 PM, Claude Pache wrote:
>> >/   From the thread [1], I guess that parsing correctly the following thing would be obnoxious (at best)?
>> />/
>> />/  	(a = yield/b/g) =>* {}
>> />/
>> />/  —Claude
>> /
>> Indeed.
>>
>> And you can make even more obnoxious parses of the hypothetical combination of =>*, default parameters, and retroactive yield-scope:
>>
>> (a = yield/"/) =>* (/"/g)
>>
>> Are the two /"/'s regexps or is "/) =>* (/" a string token?
>>
>>       Waldemar
>
> Are you sure? The `(a = yield/b/g)` part is parsed at first as a parenthesised expression and only later (after the `=>` token) reinterpreted as an ArrowFormalParameters grammar production.
>
> - André

Fine, so do this one instead:

(a = yield/"/g, b = yield/"/g) =>* {}

Does this generator have one or two parameters?

     Waldemar



More information about the es-discuss mailing list