From f8586a3fb092eed5f225657af13a195ffe411283 Mon Sep 17 00:00:00 2001 From: Paul Mathieu Date: Mon, 22 Feb 2021 20:34:35 -0800 Subject: [PATCH] Fix eq --- tools/cc.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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)