Implémenting while loop

This commit is contained in:
Anthony Debucquoy 2025-03-20 17:34:27 +01:00
parent 76e2707156
commit 948b335cb5
Signed by: tonitch
GPG Key ID: A78D6421F083D42E

6
spf.py
View File

@ -15,10 +15,8 @@ class SPFInterpreter(lark.visitors.Interpreter):
self.variables = Variables(trace)
def while_loop(self, el):
print("TODO: while")
cond = el.children[0]
instr = el.children[1:]
print(cond.pretty())
while self.visit_children(el.children[0])[0]:
[self.visit_children(i) for i in el.children[1:]]
def for_loop(self, el):
print("TODO: for")