Documentation ¶ Index ¶ func Rewrite(n syntax.Node, f func(syntax.Node) NodeAction) syntax.Node type NodeAction Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func Rewrite ¶ func Rewrite(n syntax.Node, f func(syntax.Node) NodeAction) syntax.Node Rewrite traverses a syntax tree in depth-first order. It starts by calling f(n); n must not be nil. f then returns whether to Rewrite itself recursively or to replace n. Rewrite then calls f(nil). Types ¶ type NodeAction ¶ type NodeAction struct { Recurse bool Replace bool ReplaceBy syntax.Node } Source Files ¶ View all Source files rewrite.go Click to show internal directories. Click to hide internal directories.