diff --git a/test/bytecode_3.8_run/04_for_no_jump_back.pyc-notyet b/test/bytecode_3.8_run/04_for_no_jump_back.pyc-notyet deleted file mode 100644 index fb7672f9..00000000 Binary files a/test/bytecode_3.8_run/04_for_no_jump_back.pyc-notyet and /dev/null differ diff --git a/test/simple_source/bug38/04_for_no_jump_back.py b/test/simple_source/bug38/04_for_no_jump_back.py index 84d425dc..e20df54b 100644 --- a/test/simple_source/bug38/04_for_no_jump_back.py +++ b/test/simple_source/bug38/04_for_no_jump_back.py @@ -1,6 +1,8 @@ # from mult_by_const/instruction.py # Bug in 3.8 was handling no JUMP_BACK in "for" loop. It is # in the "if" instead + +# RUNNABLE! def instruction_sequence_value(instrs, a, b): for instr in instrs: if a: diff --git a/uncompyle6/parsers/parse38.py b/uncompyle6/parsers/parse38.py index a8d7efad..1ccd1475 100644 --- a/uncompyle6/parsers/parse38.py +++ b/uncompyle6/parsers/parse38.py @@ -85,7 +85,7 @@ class Python38Parser(Python37Parser): # 3.8 can push a looping JUMP_BACK into into a JUMP_ from a statement that jumps to it lastl_stmt ::= ifpoplaststmtl - ifpoplaststmtl ::= testexpr POP_TOP c_stmts_opt JUMP_BACK + ifpoplaststmtl ::= testexpr POP_TOP c_stmts_opt ifelsestmtl ::= testexpr c_stmts_opt jb_cfs else_suitel JUMP_BACK come_froms # Keep indices the same in ifelsestmtl diff --git a/uncompyle6/semantics/consts.py b/uncompyle6/semantics/consts.py index 566c0997..ed317636 100644 --- a/uncompyle6/semantics/consts.py +++ b/uncompyle6/semantics/consts.py @@ -471,19 +471,19 @@ MAP_R0 = (TABLE_R0, -1, 0) MAP_R = (TABLE_R, -1) MAP = { - 'stmt': MAP_R, - 'call': MAP_R, - 'del_stmt': MAP_R, - 'store': MAP_R, - 'exprlist': MAP_R0, + "stmt": MAP_R, + "call": MAP_R, + "del_stmt": MAP_R, + "store": MAP_R, + "exprlist": MAP_R0, } ASSIGN_TUPLE_PARAM = lambda param_name: \ - SyntaxTree('expr', [ Token('LOAD_FAST', pattr=param_name) ]) + SyntaxTree("expr", [ Token("LOAD_FAST", pattr=param_name) ]) -escape = re.compile(r''' +escape = re.compile(r""" (?P [^%]* ) % ( \[ (?P -? \d+ ) \] )? ((?P [^{] ) | ( [{] (?P [^}]* ) [}] )) - ''', re.VERBOSE) + """, re.VERBOSE)