From 1015a0947e2bf2312607dec03842d4045394b0b5 Mon Sep 17 00:00:00 2001 From: Anthony Debucquoy Date: Sat, 22 Mar 2025 23:08:03 +0100 Subject: [PATCH] removing old code --- spf.lark | 1 - spf.py | 62 -------------------------------------------------------- 2 files changed, 63 deletions(-) diff --git a/spf.lark b/spf.lark index f2c6b20..a87728a 100644 --- a/spf.lark +++ b/spf.lark @@ -35,7 +35,6 @@ priority: finalterm | NEG_OP finalterm | NOT_OP finalterm - finalterm: "(" expression ")" | literal | list diff --git a/spf.py b/spf.py index 31725d1..903b2d3 100755 --- a/spf.py +++ b/spf.py @@ -52,68 +52,6 @@ class SPFInterpreter(lark.visitors.Interpreter): value = self.visit_children(el.children[2])[0] self.variables.assign(name, value) - # def and_op(self, el): - # (left, sign, right) = self.visit_children(el) - # return left and right - # - # def or_op(self, el): - # (left, sign, right) = self.visit_children(el) - # return left or right - # - # - # def equal(self, el): - # (left, sign, right) = self.visit_children(el) - # return left == right - # - # def unequal(self, el): - # (left, sign, right) = self.visit_children(el) - # return left != right - # - # def lt(self, el): - # (left, sign, right) = self.visit_children(el) - # return left < right - # - # def le(self, el): - # (left, sign, right) = self.visit_children(el) - # return left <= right - # - # def gt(self, el): - # (left, sign, right) = self.visit_children(el) - # return left > right - # - # def ge(self, el): - # (left, sign, right) = self.visit_children(el) - # return left >= right - # - # - # def plus(self, el): - # (left, sign, right) = self.visit_children(el) - # return left + right # Cool ça fonctionne pour les str - # - # def minus(self, el): - # (left, sign, right) = self.visit_children(el) - # return left - right - # - # def time(self, el): - # (left, sign, right) = self.visit_children(el) - # return left * right - # - # def divide(self, el): - # (left, sign, right) = self.visit_children(el) - # return left / right - # - # sizeof = lambda self, el:len(self.visit_children(el)[1]) - # neg = lambda self, el:-self.visit_children(el)[1] - # - # def not_op(self, el): - # (sign, right) = self.visit_children(el) - # return not right - # - # - # def list_get(self, el): - # (left, right) = self.visit_children(el) - # return left[right-1] - def expression(self, el): return self.visit_children(el)[0]