AstSearch

package module
v0.0.0-...-0b8cadb Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SearchNodes

func SearchNodes(decl ast.Node, foundNodes *[]*FoundNodes, parents []ast.Node, searchFunction func(node ast.Node, parents []ast.Node, completed *bool) bool, completed *bool)

SearchNodes Searches the Ast-tree. The search function decides what's a match. foundNodes holds all matches including their parents. This allows to modify a method call inside a function, then traverses upwards to modify the containing function parameters as well. Set completed to true inside the search function, if the search should be terminated.

Types

type FoundNodes

type FoundNodes struct {
	Node    ast.Node
	Parents []ast.Node
}

FoundNodes holds the information for each found node

Jump to

Keyboard shortcuts

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