package walk

import "cuelang.org/go/internal/core/walk"

walk provides functions for visiting the nodes of an ADT tree.

Index

Functions

func Features

func Features(x adt.Expr, f func(label adt.Feature, src adt.Node))

Features calls f for all features used in x and indicates whether the feature is used as a reference or not.

Types

type Visitor

type Visitor struct {
	// Feature is invoked for all field names.
	Feature func(f adt.Feature, src adt.Node)

	// Before is invoked for all invoked for all nodes in pre-order traversal.
	// Return false prevents the visitor from visiting the nodes descendant
	// elements.
	Before func(adt.Node) bool
}

A Visitor walks over all elements in an ADT, recursively.

func (*Visitor) Elem

func (w *Visitor) Elem(x adt.Elem)

Source Files

walk.go

Version
v0.6.0-alpha.2
Published
Jun 28, 2023
Platform
js/wasm
Imports
2 packages
Last checked
48 minutes ago

Tools for package owners.