On 12/16/2013 12:57 PM, Andrew Sutherland wrote:
The Esprima JS parser can already generate comment nodes. The API otherwise conforms to the same output standards as SpiderMonkey's Parser API.

There's also acorn, which is an ES5 parser written in JS that's in the tree (http://mxr.mozilla.org/mozilla-central/source/toolkit/devtools/acorn). The down side to both acorn and esprima is that neither support SpiderMonkey specific extensions and syntax. Esprima supports most or all of ES6 syntax (in its harmony branch) but some of the features in SM aren't compatible with ES6 (for example, array/generator expressions have the reverse order in SM from ES6).

We added acorn to the tree for devtools because we needed a tokenizer and access to comments.
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to