Skip to content

[feature] implement a visitor & filter helper #198

Description

@ichiriac

implement a visitor helper in order to handle AST transversal :

const ast = parser.parse('...some code...');

// visiting child nodes :
ast.visit(function(node) {
  // do something
});

// filtering a list of nodes
const nodes = ast.filter(function(node) {
  return node.kind === 'something';
});

NOTE : this is implemented on each node, can be used on program node as in the example, or on any other node

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions