slight fixes to cte
This commit is contained in:
4
main.py
4
main.py
@@ -1454,9 +1454,11 @@ class CompileTimeVM:
|
||||
label_positions = self._label_positions(nodes)
|
||||
loop_pairs = self._for_pairs(nodes)
|
||||
begin_pairs = self._begin_pairs(nodes)
|
||||
prev_loop_stack = self.loop_stack
|
||||
self.loop_stack = []
|
||||
begin_stack: List[Dict[str, int]] = []
|
||||
ip = 0
|
||||
try:
|
||||
while ip < len(nodes):
|
||||
node = nodes[ip]
|
||||
kind = node.op
|
||||
@@ -1543,6 +1545,8 @@ class CompileTimeVM:
|
||||
continue
|
||||
|
||||
raise ParseError(f"unsupported compile-time op {node!r}")
|
||||
finally:
|
||||
self.loop_stack = prev_loop_stack
|
||||
|
||||
def _label_positions(self, nodes: Sequence[Op]) -> Dict[str, int]:
|
||||
positions: Dict[str, int] = {}
|
||||
|
||||
Reference in New Issue
Block a user