3.8 for block without a POP_BLOCK ...

and confusing JUMP_BACK for CONTINUE. Expect more like this.

Fixes #293
This commit is contained in:
rocky
2019-10-29 13:32:43 -04:00
parent 0b111f1568
commit dba6d24361
3 changed files with 6 additions and 0 deletions

Binary file not shown.

View File

@@ -0,0 +1,5 @@
# Bug is turning a JUMP_BACK for a CONTINUE so for has no JUMP_BACK.
# Also there is no POP_BLOCK since there isn't anything in the loop.
# In the future when we have better control flow, we might redo all of this.
for i in range(2):
pass

View File

@@ -92,6 +92,7 @@ class Python38Parser(Python37Parser):
for38 ::= expr get_iter store for_block JUMP_BACK
for38 ::= expr for_iter store for_block JUMP_BACK
for38 ::= expr for_iter store for_block JUMP_BACK POP_BLOCK
for38 ::= expr for_iter store for_block
forelsestmt38 ::= expr for_iter store for_block POP_BLOCK else_suite
forelselaststmt38 ::= expr for_iter store for_block POP_BLOCK else_suitec