Help us shape the future of Go! Take the 2026 Go Developer Survey

ast

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsRuleName

func IsRuleName(node Node, name string) bool

func IsRuleNameOneOf

func IsRuleNameOneOf(node Node, names []string) bool

Types

type Node

type Node interface {
	Rule() rule.Rule
	SetRule(rule.Rule)
	Parent() Node
	SetParent(Node)
	Children() []Node
	SetChildren([]Node)
	HasChildren() bool
	Raw() []byte
	SetRaw([]byte)
}

func DefaultEmptyNode

func DefaultEmptyNode() Node

func DefaultRootNode

func DefaultRootNode() Node

func FilterNodes

func FilterNodes(nodes []Node, filter func(Node) bool) []Node

func FilterNodesInTree

func FilterNodesInTree(node Node, filter func(Node) bool) []Node

func FindGlobalCompDef

func FindGlobalCompDef(root Node, name string) Node

func FindLocalCompDef

func FindLocalCompDef(srcNode Node, name string) Node

func FindNode

func FindNode(nodes []Node, filter func(Node) bool) Node

func FindNodeByRuleName

func FindNodeByRuleName(nodes []Node, name string) Node

func GetAncestors

func GetAncestors(node Node) []Node

Jump to

Keyboard shortcuts

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