Implémenting while loop
This commit is contained in:
		
							
								
								
									
										6
									
								
								spf.py
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								spf.py
									
									
									
									
									
								
							| @ -15,10 +15,8 @@ class SPFInterpreter(lark.visitors.Interpreter): | |||||||
|         self.variables = Variables(trace) |         self.variables = Variables(trace) | ||||||
|  |  | ||||||
|     def while_loop(self, el): |     def while_loop(self, el): | ||||||
|         print("TODO: while") |         while self.visit_children(el.children[0])[0]: | ||||||
|         cond = el.children[0] |             [self.visit_children(i) for i in el.children[1:]] | ||||||
|         instr = el.children[1:] |  | ||||||
|         print(cond.pretty()) |  | ||||||
|  |  | ||||||
|     def for_loop(self, el): |     def for_loop(self, el): | ||||||
|         print("TODO: for") |         print("TODO: for") | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user