@@ -74,15 +74,15 @@ function combine_operators(tree::Node{T,2}, operators::AbstractOperatorEnum) whe
7474 # (const - (const - var)) => (var - const)
7575 l = get_child (tree, 1 )
7676 r = get_child (tree, 2 )
77- simplified_const = (get_child (r, 1 ). val - l. val) # neg(sub(l.val, r.l .val))
77+ simplified_const = (get_child (r, 1 ). val - l. val) # neg(sub(l.val, get_child(r, 1) .val))
7878 set_child! (tree, get_child (get_child (tree, 2 ), 2 ), 1 )
7979 set_child! (tree, l, 2 )
8080 get_child (tree, 2 ). val = simplified_const
8181 elseif is_node_constant (get_child (get_child (tree, 2 ), 2 ))
8282 # (const - (var - const)) => (const - var)
8383 l = get_child (tree, 1 )
8484 r = get_child (tree, 2 )
85- simplified_const = l. val + get_child (r, 2 ). val # plus(l.val, r.r .val)
85+ simplified_const = l. val + get_child (r, 2 ). val # plus(l.val, get_child(r, 2) .val)
8686 set_child! (tree, get_child (get_child (tree, 2 ), 1 ), 2 )
8787 get_child (tree, 1 ). val = simplified_const
8888 end
@@ -93,15 +93,15 @@ function combine_operators(tree::Node{T,2}, operators::AbstractOperatorEnum) whe
9393 # ((const - var) - const) => (const - var)
9494 l = get_child (tree, 1 )
9595 r = get_child (tree, 2 )
96- simplified_const = get_child (l, 1 ). val - r. val# sub(l.l .val, r.val)
96+ simplified_const = get_child (l, 1 ). val - r. val# sub(get_child(l, 1) .val, r.val)
9797 set_child! (tree, get_child (get_child (tree, 1 ), 2 ), 2 )
9898 set_child! (tree, r, 1 )
9999 get_child (tree, 1 ). val = simplified_const
100100 elseif is_node_constant (get_child (get_child (tree, 1 ), 2 ))
101101 # ((var - const) - const) => (var - const)
102102 l = get_child (tree, 1 )
103103 r = get_child (tree, 2 )
104- simplified_const = r. val + get_child (l, 2 ). val # plus(r.val, l.r .val)
104+ simplified_const = r. val + get_child (l, 2 ). val # plus(r.val, get_child(l, 2) .val)
105105 set_child! (tree, get_child (get_child (tree, 1 ), 1 ), 1 )
106106 get_child (tree, 2 ). val = simplified_const
107107 end
0 commit comments