AddChild adds a child to the expression.
(child *Expression)
| 17 | |
| 18 | // AddChild adds a child to the expression. |
| 19 | func (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. |
| 29 | func (expr *Expression) EachLeaf(yield func(*Expression) bool) bool { |
no outgoing calls
no test coverage detected