This commit is contained in:
Paul Mathieu 2021-02-22 20:34:35 -08:00
parent fbeb22df5a
commit f8586a3fb0

View File

@ -885,7 +885,8 @@ class CcInterp(lark.visitors.Interpreter):
def _combo(uop, bop): def _combo(uop, bop):
def _f(self, tree): def _f(self, tree):
bop.__get__(self)(tree) ftree = lark.Tree(bop, tree.children)
tree.children = [ftree]
uop.__get__(self)(tree) uop.__get__(self)(tree)
return _f return _f
@ -898,7 +899,7 @@ class CcInterp(lark.visitors.Interpreter):
gt = _binary_op(GtOp) gt = _binary_op(GtOp)
lt = _binary_op(LtOp) lt = _binary_op(LtOp)
neq = _binary_op(NeqOp) neq = _binary_op(NeqOp)
eq = _combo(bool_not, neq) eq = _combo(bool_not, 'neq')
def _forward_op(self, tree): def _forward_op(self, tree):
self.visit_children(tree) self.visit_children(tree)