Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mozilla Parser API #32

Open
mvcisback opened this issue Jun 22, 2014 · 3 comments
Open

Mozilla Parser API #32

mvcisback opened this issue Jun 22, 2014 · 3 comments

Comments

@mvcisback
Copy link

Hey, it'd be really cool if this tool could emit json compatable with the Mozilla Parser API.
Alot of tools conform to it, so it'd make hooking into them alot easier.

I believe it should be a (lossy) transformation on the AST implemented.

@alanz
Copy link
Collaborator

alanz commented Jun 22, 2014

It looks interesting. Pull requests welcomed :)

@mvcisback
Copy link
Author

I whipped up a prototype type specification yesterday:
https://github.com/mvcisback/parser_api/blob/master/MozillaApi.hs

It's pretty heavily based on https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Parser_API with the omission of E4X stuff.
I think there should be a pretty 1-1 transformation of that to the JSON SpiderMonkey and acorn (and a few other parsers) emit.

I imagine the conversion from to the more concrete syntax to the mozilla parser api might require abit of time for me to figure out, although it looks like showStripped does alot of what I will need.

@achudnov
Copy link

See also https://github.com/jswebtools/mozilla-js-parser-api, more tests, bug reports, pull requests are welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants