> > Anyway, I'm still trying to get something for shorter function syntax into > ES6. I think TC39 can yet make an exception if we have our validation story > figured out. That is where to focus fire.
Must it be LR(1), then? I don't think an LR parser can handle short functions (or arrows) as we've laid them out. Essentially, we can't reduce *anything* until we know whether we're trying to parse an ( Expression ) or a ( FormalParameterList ). Same goes for Dart. And yet my intuition tells me it's unambiguous nonetheless (or that it can be, if the grammar is constructed with care). I think that the procedure I outlined yesterday can be implemented efficiently, especially for the expected case where a parameter list is short (e.g. not the length of the entire file). And since the source code of every parsed function has to stay in memory anyway (via Function.prototype.toString), I don't think the arbitrary lookahead imposes additional restrictions there. Given this situation, what kind of validation story would be sufficient? kevin
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

