You need to be very careful hacking around in an ad-hoc parser. It's easy
to diverge from the formal (and verified) grammar by accident. Ambiguous
grammars with ad-hoc disambiguation rules codified only by your parser's
source code are bad business. Voice of experience here.

/be

On Sat, May 21, 2016 at 3:57 PM Isiah Meadows <isiahmead...@gmail.com>
wrote:

> I'm aware it's specified as a cover grammar, which is the easiest way I'm
> aware of to do it in a traditional declarative grammar. If you're writing a
> parser, though, you'll probably be using a mixture of lookahead and
> speculative parsing, or something to that effect, in practice, since it's
> faster.
>
> On Thu, May 19, 2016, 16:38 Kevin Smith <zenpars...@gmail.com> wrote:
>
>> I will note that JavaScript does already require n-token lookahead worst
>>> case to disambiguate arrow functions from sequence expressions.
>>>
>> The syntax is actually specified in terms of cover grammars, not
>> arbitrary lookahead.
>>
>> _______________________________________________
> es-discuss mailing list
> es-discuss@mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to