Re: Parser for ES6?
The Closure Compiler parser is here: https://github.com/google/closure-compiler/tree/master/src/com/google/javascript/jscomp/parsing/parser I know it is still missing new.target, I believe it is otherwise up to date. On Thu, May 7, 2015 at 10:42 AM, Michael Ficarra mfica...@shapesecurity.com wrote: The Shift parser has, to my knowledge, the most complete support for ES6. You can try it out in the online demo at http://jsoverson.github.io/shift-visualizer/. Note that the demo is using a slightly out of date parser, but I've asked the maintainer to update it ASAP. On Thu, May 7, 2015 at 8:52 AM, Mathias Bynens mathi...@opera.com wrote: On Thu, May 7, 2015 at 5:37 PM, Park, Daejun dpar...@illinois.edu wrote: Is there any parser for ES6? https://github.com/shapesecurity/shift-parser-js supports ES6/ES2015 RC2. You can read more about it here: http://engineering.shapesecurity.com/2015/04/two-phase-parsing.html ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss -- Shape Security is hiring outstanding individuals. Check us out at *https://shapesecurity.com/jobs/ https://shapesecurity.com/jobs/* ___ 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
Re: Parser for ES6?
The Shift parser has, to my knowledge, the most complete support for ES6. You can try it out in the online demo at http://jsoverson.github.io/shift-visualizer/. Note that the demo is using a slightly out of date parser, but I've asked the maintainer to update it ASAP. On Thu, May 7, 2015 at 8:52 AM, Mathias Bynens mathi...@opera.com wrote: On Thu, May 7, 2015 at 5:37 PM, Park, Daejun dpar...@illinois.edu wrote: Is there any parser for ES6? https://github.com/shapesecurity/shift-parser-js supports ES6/ES2015 RC2. You can read more about it here: http://engineering.shapesecurity.com/2015/04/two-phase-parsing.html ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss -- Shape Security is hiring outstanding individuals. Check us out at *https://shapesecurity.com/jobs/ https://shapesecurity.com/jobs/* ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss
Re: Parser for ES6?
On Thu, May 7, 2015 at 5:37 PM, Park, Daejun dpar...@illinois.edu wrote: Is there any parser for ES6? https://github.com/shapesecurity/shift-parser-js supports ES6/ES2015 RC2. You can read more about it here: http://engineering.shapesecurity.com/2015/04/two-phase-parsing.html ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss
Parser for ES6?
Hi, Is there any parser for ES6? It seems that no implementation completely supports ES6 yet (http://kangax.github.io/compat-table/es6/), and I'm just curious to see if there is at least a parser supporting all the features of ES6. For example, the grammar given in the spec seems to be fit to a parser generator, and I wonder if the grammar has been mechanized in such a parser generator or is just a written spec. Best, Daejun ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss
Re: Parser for ES6?
There's my crappy transpiler: https://github.com/joeedh/fairmotion/tree/master/tools/extjs_cc Which uses a parser generator (and yes, the standard is quite helpful in pointing out ways to make JS work in a bottom-up grammar). The grammar is inline with the code, so I've extracted it and attached it to this email. Note that I've extended the grammar a bit, mostly to implement a type annotation system but there are a few other non-standard things as well (I still need to replace my python-style multiline strings with template strings, for example). The grammar is also a bit messy. I believe the only thing I'm missing is template strings and some of the new numeric literal stuff (e.g. binary literals). I just recently added a bunch of stuff in preparation to move my codebase to a different transpiler (one I don't have to maintain myself). Oh, and I think I'm missing yield assignments in generators (e.g. var x = yield y), too. Also, I'm not sure if arrow functions work in all cases, I have an ambiguity in my grammar there (which I don't feel like debugging because I'm switching to babel :) ). The regular expression stuff is kindof interesting; figuring out how to parse RE literals wasn't easy (it's not strictly possible to parse them with a RE tokenizer, but I managed to hackishly make it work). Joe On Thu, May 7, 2015 at 8:37 AM, Park, Daejun dpar...@illinois.edu wrote: Hi, Is there any parser for ES6? It seems that no implementation completely supports ES6 yet (http://kangax.github.io/compat-table/es6/), and I'm just curious to see if there is at least a parser supporting all the features of ES6. For example, the grammar given in the spec seems to be fit to a parser generator, and I wonder if the grammar has been mechanized in such a parser generator or is just a written spec. Best, Daejun ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss grammar Description: Binary data ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss