HTTPS SSH

traceur-mozilla-ast

Build Status

What is it?

This library will convert traceur-compiler AST into a Mozilla Spidermonkey one.

Right now, it's only converting ES5 nodes, all ES6 nodes are ignored.

Whatever for?

Tooling. Traceur boasts an excellent ES6 parser, that can also transpile code down to ES5. This library makes it easier to take the transpiled syntax tree from Traceur, and feed it through existing tools that work with Spidermonkey AST, like estraverse and escodegen.

Location information is retained in the translation from Traceur AST.

Alternatives

I opted for this approach as a somewhat academic exercise to learn more about Traceur and AST tooling like esprima.

An alternative approach could be to run esprima over Traceur generated code, and re-attach location information from the source map that Traceur also created whilst generating the code.

License

This project is licensed under Apache 2.0. Please see accompanying LICENSE file.