ES6 module grammar - Conflicting states

Xavier CAMBAR xcambar at gmail.com
Tue Mar 6 16:39:41 PST 2012


Hi all,
I was looking at the grammar defined at
http://wiki.ecmascript.org/doku.php?id=harmony:modules (Last modified:
2012/02/27 17:27 by samth) and noticed conflicting states during
tokenization. Consider the following expression:

export x, y, z;

According to the grammar defined in the wiki, this expression might have
two (undecidable) tokenized forms:

ExportDeclaration
  -> ExportSpecifierSet
    -> Id
    -> Id
    -> Id

ExportDeclaration
  -> ExportSpecifierSet
    -> Id
  -> ExportSpecifierSet
    -> Id
  -> ExportSpecifierSet
    -> Id


The issue here is that parsers won't be able to choose one form or the
other.
I've posted a possible fix for the grammar here:
https://gist.github.com/1990115.

Hope this helps,
Regards,

-- 
Xavier CAMBAR
@xcambar <https://twitter.com/#!/xcambar>
T: +33 6.84.29.46.83
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120307/8e9d8c5a/attachment.html>


More information about the es-discuss mailing list