Open mvcisback opened 10 years ago
It looks interesting. Pull requests welcomed :)
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.
See also https://github.com/jswebtools/mozilla-js-parser-api, more tests, bug reports, pull requests are welcome.
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.