Function traverse
- traverse(node, onEnter?, onLeave?): void
Parameters
- node: RootResult
the node to start traversing at.
Optional
onEnter: NodeVisitornode visitor function that will be called on entering the node. This corresponds to preorder traversing.
Optional
onLeave: NodeVisitornode visitor function that will be called on leaving the node. This corresponds to postorder traversing.
Returns void
- node: RootResult
A function to traverse an AST. It traverses it depth first.