Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/estree/estree
The ESTree Spec
https://github.com/estree/estree
ast estree javascript parsing specification
Last synced: 2 days ago
JSON representation
The ESTree Spec
- Host: GitHub
- URL: https://github.com/estree/estree
- Owner: estree
- License: other
- Created: 2015-02-12T01:09:18.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2024-10-18T15:58:41.000Z (about 2 months ago)
- Last Synced: 2024-10-29T15:27:15.764Z (about 1 month ago)
- Topics: ast, estree, javascript, parsing, specification
- Homepage:
- Size: 176 KB
- Stars: 5,123
- Watchers: 142
- Forks: 358
- Open Issues: 44
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Governance: docs/governance.md
Awesome Lists containing this project
- awesome - estree - The ESTree Spec (Others)
- awesome-github-repos - estree/estree - The ESTree Spec (Others)
- awesome-github-star - estree
- awesome-ast - ESTree spec
- awesome-starred - estree/estree - The ESTree Spec (parsing)
README
# The ESTree Spec
Once upon a time, an [unsuspecting Mozilla engineer](http://calculist.org) created an API in Firefox that exposed the SpiderMonkey engine's JavaScript parser as a JavaScript API. Said engineer [documented the format it produced](https://web.archive.org/web/20210314002546/https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Parser_API), and this format caught on as a lingua franca for tools that manipulate JavaScript source code.
Meanwhile JavaScript is evolving. This site will serve as a community standard for people involved in building and using these tools to help evolve this format to keep up with the evolution of the JavaScript language.
# AST Descriptor Syntax
The spec uses a custom syntax to describe its structures. For example, at the
time of writing, 'es2015.md' contained a description of `Program` as seen below```js
extend interface Program {
sourceType: "script" | "module";
body: [ Statement | ImportOrExportDeclaration ];
}
```# ESTree Steering Committee
* [Nicholas C. Zakas](https://github.com/nzakas) ([ESLint](https://github.com/eslint))
* [Ingvar Stepanyan](https://github.com/rreverser) ([Acorn](https://github.com/acornjs/acorn))
* [Junliang Huang](https://github.com/JLHwung) ([Babel](https://github.com/babel))# Copyright and License
Copyright Mozilla Contributors and ESTree Contributors.
Licensed under [Creative Commons Sharealike](https://creativecommons.org/licenses/by-sa/2.5/).
# Philosophy
Suggested additions and modifications must follow these guidelines:
1. **Backwards compatible:** Non-additive modifications to existing constructs will not be considered unless immense support is in favor of such changes. ([eg. #65](https://github.com/estree/estree/issues/65))
2. **Contextless:** Nodes should not retain any information about their parent. ie. a `FunctionExpression` should not be aware of if it's a concise method. (eg. [#5](https://github.com/estree/estree/issues/5))
3. **Unique:** Information should not be duplicated. ie. a `kind` property should not be present on `Literal` if the type can be discerned from the `value`. (eg. [#61](https://github.com/estree/estree/issues/61))
4. **Extensible:** New nodes should be specced to easily allow future spec additions. This means expanding the coverage of node types. ie. `MetaProperty` over `NewTarget` to cover future meta properties. (eg. [#32](https://github.com/estree/estree/pull/32))# Acknowledgements
ESTree has benefited from the contributions of many people over the years. We'd like to thank these folks for their significant contributions to this project:
[Sebastian McKenzie](https://github.com/sebmck) ([Babel](https://github.com/babel/babel)), Kyle Simpson ([@getify](https://github.com/getify)), [Mike Sherov](https://github.com/mikesherov) ([Esprima](https://github.com/jquery/esprima)), [Ariya Hidayat](https://github.com/ariya) ([Esprima](https://github.com/jquery/esprima)), [Adrian Heine](https://github.com/adrianheine) ([Acorn](https://github.com/acornjs/acorn)), [Dave Herman](https://github.com/dherman) (SpiderMonkey), Michael Ficarra ([@michaelficarra](https://github.com/michaelficarra)).