removing old code
This commit is contained in:
parent
07fa61ef6c
commit
1015a0947e
1
spf.lark
1
spf.lark
@ -35,7 +35,6 @@ priority: finalterm
|
|||||||
| NEG_OP finalterm
|
| NEG_OP finalterm
|
||||||
| NOT_OP finalterm
|
| NOT_OP finalterm
|
||||||
|
|
||||||
|
|
||||||
finalterm: "(" expression ")"
|
finalterm: "(" expression ")"
|
||||||
| literal
|
| literal
|
||||||
| list
|
| list
|
||||||
|
62
spf.py
62
spf.py
@ -52,68 +52,6 @@ class SPFInterpreter(lark.visitors.Interpreter):
|
|||||||
value = self.visit_children(el.children[2])[0]
|
value = self.visit_children(el.children[2])[0]
|
||||||
self.variables.assign(name, value)
|
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):
|
def expression(self, el):
|
||||||
return self.visit_children(el)[0]
|
return self.visit_children(el)[0]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user