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

Traverse generic nodes #1

Open
dy opened this issue Feb 18, 2015 · 2 comments
Open

Traverse generic nodes #1

dy opened this issue Feb 18, 2015 · 2 comments

Comments

@dy
Copy link

dy commented Feb 18, 2015

Is there a sense to add generic nodes to traversing, such as Expression, Function, Node, Statement, Declaration, Pattern?

That is done in ast-types, and that feature seems to be quite useful.

For example:

visit(ast, {
  //walk into any node
  Node: function(node){
  }
});

Just an idea.

@Constellation
Copy link
Member

That sounds very nice.
I'm now planning to generate estraverse and esrecurse node shape spec from estree automatically.
That has category information (such as, Node, Statement etc.) So after that, based on this category, we can implement your suggestion :)

@nfroidure
Copy link

👍

Would also like to have a OtherNode property to handle any other node than those already managed.

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