pulumi/pkg
joeduffy 259135c15d Add a visitation API
This change introduces a new visitation API to the new MuIL AST.
The ast.Walk API takes an ast.Visitor implementation and walks the
tree in depth-first order, invoking the visitor along the way.

The visitor gets to choose whether to continue visitation (by returning
a non-nil visitor object), or to stop it (by returning nil).  The
visitation will proceed with that returned visitor, so that a visitor
can "swap out" the visitor used for child nodes if needed.

At the end, the PostVisit function is called, for any clean up logic.

Finally, the ast.Inspector type is available as a simple way of consing
up visitors simply using a function that returns a bool indicating
whether visitation should continue.
2017-01-18 07:56:53 -08:00
..
ast Split pkg/ast; merge symbol code into pkg/symbols 2017-01-17 17:41:28 -08:00
cmdutil Begin merging MuPackage/MuIL into the compiler 2017-01-17 17:04:15 -08:00
compiler Delete predefined types 2017-01-17 17:50:23 -08:00
diag Implement diag.Diagable on MuIL AST nodes 2017-01-17 18:01:11 -08:00
encoding Begin merging MuPackage/MuIL into the compiler 2017-01-17 17:04:15 -08:00
errors Split pkg/ast; merge symbol code into pkg/symbols 2017-01-17 17:41:28 -08:00
graph Split pkg/ast; merge symbol code into pkg/symbols 2017-01-17 17:41:28 -08:00
options Begin merging MuPackage/MuIL into the compiler 2017-01-17 17:04:15 -08:00
pack Add a visitation API 2017-01-18 07:56:53 -08:00
symbols Split pkg/ast; merge symbol code into pkg/symbols 2017-01-17 17:41:28 -08:00
util Begin merging MuPackage/MuIL into the compiler 2017-01-17 17:04:15 -08:00
workspace Split pkg/ast; merge symbol code into pkg/symbols 2017-01-17 17:41:28 -08:00