ASTWalker
Index
Constructors
Methods
Constructors
constructor
Returns default
Methods
traverse
Traverses the ast tree provided and invokes
callbacks.enterNode/callbacks.exitNodeParameters
ast: any
An AST Tree object hash or an array of nodes.
callbacks: any
An object hash containing a function for
enterNodeand / orexitNodekeys.
Returns void
ASTWalker - Provides a simple AST traversal utility that traverses all nodes / children regardless of type.
A callback object is provided in
traversewhich may contain two methodsenterNodeandexitNodewhich are invoked with the current node and the parent node respectively when entering and exiting a given node.enterNodemay return a array of strings which provide a set of children keys to ignore.enterNodemay also return null to skip traversing children keys entirely.