Skip to content

[feature] implement a visitor & filter helper #198

Open
@ichiriac

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions