Improved function names

This commit is contained in:
Eduard Urbach 2024-06-25 23:37:14 +02:00
parent 37e222e022
commit 871ebc147f
Signed by: eduard
GPG key ID: 49226B848C78F6C8
19 changed files with 94 additions and 114 deletions

View file

@ -71,28 +71,6 @@ func (expr *Expression) EachLeaf(call func(*Expression) error) error {
return nil
}
// EachOperation iterates through all the operations in the tree.
func (expr *Expression) EachOperation(call func(*Expression) error) error {
if expr.IsLeaf() {
return nil
}
// Don't descend into the parameters of function calls
if expr.Token.Text() == "λ" {
return call(expr)
}
for _, child := range expr.Children {
err := child.EachOperation(call)
if err != nil {
return err
}
}
return call(expr)
}
// RemoveChild removes a child from the expression.
func (expr *Expression) RemoveChild(child *Expression) {
for i, c := range expr.Children {