diff --git a/uncompyle6/parsers/parse3.py b/uncompyle6/parsers/parse3.py index 4adb3973..e07e7958 100644 --- a/uncompyle6/parsers/parse3.py +++ b/uncompyle6/parsers/parse3.py @@ -165,6 +165,7 @@ class Python3Parser(PythonParser): ifelsestmtr ::= testexpr return_if_stmts return_stmts ifelsestmtl ::= testexpr c_stmts_opt JUMP_BACK else_suitel + ifelsestmtl ::= testexpr c_stmts_opt COME_FROM JUMP_BACK else_suitel # FIXME: this feels like a hack. Is it just 1 or two # COME_FROMs? the parsed tree for this and even with just the @@ -369,6 +370,9 @@ class Python3Parser(PythonParser): while1stmt ::= SETUP_LOOP l_stmts while1stmt ::= SETUP_LOOP l_stmts COME_FROM_LOOP + while1stmt ::= SETUP_LOOP l_stmts COME_FROM JUMP_BACK COME_FROM_LOOP + + # FIXME: investigate - can code really produce a NOP? whileTruestmt ::= SETUP_LOOP l_stmts_opt JUMP_BACK NOP COME_FROM_LOOP diff --git a/uncompyle6/parsers/parse35.py b/uncompyle6/parsers/parse35.py index 3e644b76..9e6cf248 100644 --- a/uncompyle6/parsers/parse35.py +++ b/uncompyle6/parsers/parse35.py @@ -20,6 +20,9 @@ class Python35Parser(Python34Parser): # I'm sure by the time Python 4 comes around these will be turned # into special opcodes + while1stmt ::= SETUP_LOOP l_stmts COME_FROM JUMP_BACK + POP_BLOCK COME_FROM_LOOP + # Python 3.5+ Await statement stmt ::= await_stmt await_stmt ::= call_function GET_AWAITABLE LOAD_CONST YIELD_FROM POP_TOP