starlark

package
v0.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

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
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL