diff --git a/tools/cc.py b/tools/cc.py index ac70e2c..7ade75c 100644 --- a/tools/cc.py +++ b/tools/cc.py @@ -885,7 +885,8 @@ class CcInterp(lark.visitors.Interpreter): def _combo(uop, bop): def _f(self, tree): - bop.__get__(self)(tree) + ftree = lark.Tree(bop, tree.children) + tree.children = [ftree] uop.__get__(self)(tree) return _f @@ -898,7 +899,7 @@ class CcInterp(lark.visitors.Interpreter): gt = _binary_op(GtOp) lt = _binary_op(LtOp) neq = _binary_op(NeqOp) - eq = _combo(bool_not, neq) + eq = _combo(bool_not, 'neq') def _forward_op(self, tree): self.visit_children(tree)