diff --git a/uncompyle6/parsers/parse2.py b/uncompyle6/parsers/parse2.py index a76a970b..56ba9713 100644 --- a/uncompyle6/parsers/parse2.py +++ b/uncompyle6/parsers/parse2.py @@ -41,6 +41,7 @@ class Python2Parser(PythonParser): def p_stmt2(self, args): """ while1stmt ::= SETUP_LOOP l_stmts_opt JUMP_BACK POP_BLOCK COME_FROM + while1stmt ::= SETUP_LOOP l_stmts JUMP_BACK COME_FROM while1stmt ::= SETUP_LOOP l_stmts JUMP_BACK POP_BLOCK COME_FROM while1elsestmt ::= SETUP_LOOP l_stmts JUMP_BACK POP_BLOCK else_suite COME_FROM diff --git a/uncompyle6/scanners/scanner27.py b/uncompyle6/scanners/scanner27.py index 885be81e..0fab1c0f 100755 --- a/uncompyle6/scanners/scanner27.py +++ b/uncompyle6/scanners/scanner27.py @@ -1,4 +1,4 @@ -# Copyright (c) 2015, 2016 by Rocky Bernstein +# Copyright (c) 2015-2017 by Rocky Bernstein """ Python 2.7 bytecode ingester. @@ -48,7 +48,7 @@ class Scanner27(Scanner2): self.opc.DELETE_SLICE_2, self.opc.DELETE_SLICE_3, ]) - # opcodes with expect a variable number pushed values whose + # opcodes which expect a variable number pushed values and whose # count is in the opcode. For parsing we generally change the # opcode name to include that number. varargs_ops = set([ diff --git a/uncompyle6/semantics/check_ast.py b/uncompyle6/semantics/check_ast.py index 8bca0411..efea085d 100644 --- a/uncompyle6/semantics/check_ast.py +++ b/uncompyle6/semantics/check_ast.py @@ -10,7 +10,7 @@ before reduction and don't reduce when there is a problem. def checker(ast, in_loop, errors): in_loop = in_loop or ast.type in ('while1stmt', 'whileTruestmt', - 'whilestmt', 'whileelsestmt', + 'whilestmt', 'whileelsestmt', 'while1elsestmt', 'for_block') if ast.type in ('augassign1', 'augassign2') and ast[0][0] == 'and': text = str(ast) diff --git a/uncompyle6/semantics/pysource.py b/uncompyle6/semantics/pysource.py index fba9e849..87bbf918 100644 --- a/uncompyle6/semantics/pysource.py +++ b/uncompyle6/semantics/pysource.py @@ -1786,7 +1786,9 @@ class SourceWalker(GenericASTTraversal, object): str += '*%c, **%c)' # Python 3.5 only puts optional args (the VAR part) # lowest down the stack - if self.version == 3.5: + na = (v & 0xff) # positional parameters + if self.version == 3.5 and na == 0: + print("XXX", k) if p2[2]: p2 = (2, -2, ', ') entry = (str, 0, p2, 1, -2) else: