MCPcopy Create free account
hub / github.com/akyoto/q / AddChild

Method AddChild

src/expression/Expression.go:19–26  ·  view source on GitHub ↗

AddChild adds a child to the expression.

(child *Expression)

Source from the content-addressed store, hash-verified

17
18// AddChild adds a child to the expression.
19func (expr *Expression) AddChild(child *Expression) {
20 if expr.Children == nil {
21 expr.Children = make([]*Expression, 0, 2)
22 }
23
24 expr.Children = append(expr.Children, child)
25 child.Parent = expr
26}
27
28// EachLeaf iterates through all leaves in the tree.
29func (expr *Expression) EachLeaf(yield func(*Expression) bool) bool {

Callers 5

handleLiteralFunction · 0.80
ParseFunction · 0.80
handleGroupEndFunction · 0.80
InsertAboveMethod · 0.80
handleOperatorFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected