https://github.com/rreverser/esmozy
https://github.com/rreverser/esmozy
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/rreverser/esmozy
- Owner: RReverser
- License: mit
- Created: 2017-06-02T17:14:42.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-06-03T16:21:10.000Z (about 9 years ago)
- Last Synced: 2025-04-04T20:09:23.595Z (about 1 year ago)
- Language: Rust
- Size: 5.86 KB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# esmozy
SpiderMonkey AST is largely compatible with [ESTree](https://github.com/estree/estree), and can be made fully compatible by overriding AST builders via options.
SpiderMonkey, unlike all the other JavaScript engines, exposes its parser via a public API - [`Reflect.parse`](https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Parser_API#Reflect.parse(src_options)) - available even from their JavaScript console.
This repo is a prototype to get ESTree AST in Rust by literally embedding SpiderMonkey and invoking JavaScript that calls `Reflect.parse` and passes result back in JSON format, which is easily consumable by Rust side or can be passed further.
As turned out, *(surprise!)* speed is not appealing, but it might work for prototyping JavaScript tooling in Rust until better parsers are available.