MCPcopy
hub / github.com/expr-lang/expr / Patch

Function Patch

ast/node.go:28–31  ·  view source on GitHub ↗

Patch replaces the node with a new one. Location information is preserved. Type information is lost.

(node *Node, newNode Node)

Source from the content-addressed store, hash-verified

26// Location information is preserved.
27// Type information is lost.
28func Patch(node *Node, newNode Node) {
29 newNode.SetLocation((*node).Location())
30 *node = newNode
31}
32
33// base is a base struct for all nodes.
34type base struct {

Callers 10

VisitMethod · 0.92
VisitMethod · 0.92
TestVisitor_ConstantNodeFunction · 0.92
VisitMethod · 0.92
VisitMethod · 0.92
VisitMethod · 0.92
VisitMethod · 0.92
VisitMethod · 0.92
VisitMethod · 0.92
VisitMethod · 0.92

Calls 2

SetLocationMethod · 0.65
LocationMethod · 0.65

Tested by 5

VisitMethod · 0.74
VisitMethod · 0.74
TestVisitor_ConstantNodeFunction · 0.74
VisitMethod · 0.74
VisitMethod · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…