ordered-ast-traverse
Version:
simple but flexible lexically ordered AST traversal with pre and post visitors
19 lines (14 loc) • 869 B
Markdown
Simple but flexible lexically ordered AST traversal with pre and post visitors.
Same as [ast-traverse](https://github.com/olov/ast-traverse) but instead of
visiting everything that looks like an AST node, nodes are visited according to
[](https://github.com/olov/ordered-esprima-props/blob/master/ordered-esprima-props.js).
The result is that the AST traversal happens in lexical order, i.e. an
AST-traversal in this order will visit nodes in increasing source code
position. It works with any Mozilla Parser API compatible AST, including those
generated by Esprima and Acorn, see
https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Parser_API
See [ast-traverse README](https://github.com/olov/ast-traverse/blob/master/README.md)
`MIT`, see [LICENSE](LICENSE) file.