Python 2.7.5 tolerance

This commit is contained in:
rocky
2018-05-01 02:48:41 -04:00
parent 4f61321c91
commit 24011bb0da
3 changed files with 14 additions and 0 deletions

Binary file not shown.

View File

@@ -0,0 +1,9 @@
# Issue #173. Bug is that 2.7.5 omits POP_BLOCK in
# in later 2.7 grammar.
# while1stmt ::= SETUP_LOOP l_stmts_opt JUMP_BACK COME_FROM
# while1stmt ::= SETUP_LOOP l_stmts_opt CONTINUE COME_FROM
# which is included in later code generation
ms=0
if ms==1:
while 1:
pass

View File

@@ -136,6 +136,11 @@ class Python27Parser(Python2Parser):
whilestmt ::= SETUP_LOOP testexpr returns
_come_froms POP_BLOCK COME_FROM
# 2.7.5 (and before to 2.7.0?)
while1stmt ::= SETUP_LOOP l_stmts_opt JUMP_BACK COME_FROM
while1stmt ::= SETUP_LOOP l_stmts_opt CONTINUE COME_FROM
while1stmt ::= SETUP_LOOP returns bp_come_from
while1stmt ::= SETUP_LOOP l_stmts_opt JUMP_BACK POP_BLOCK COME_FROM
whilestmt ::= SETUP_LOOP testexpr l_stmts_opt JUMP_BACK POP_BLOCK _come_froms