diff --git a/test/bytecode_3.0/00_import.pyc b/test/bytecode_3.0/00_import.pyc index 27a0cba1..4f609a49 100644 Binary files a/test/bytecode_3.0/00_import.pyc and b/test/bytecode_3.0/00_import.pyc differ diff --git a/test/bytecode_3.0/07_withstmt_fn.pyc b/test/bytecode_3.0/07_withstmt_fn.pyc new file mode 100644 index 00000000..ff446e1a Binary files /dev/null and b/test/bytecode_3.0/07_withstmt_fn.pyc differ diff --git a/uncompyle6/parsers/parse30.py b/uncompyle6/parsers/parse30.py index cb042665..e08f2771 100644 --- a/uncompyle6/parsers/parse30.py +++ b/uncompyle6/parsers/parse30.py @@ -213,6 +213,21 @@ class Python30Parser(Python31Parser): whilestmt ::= SETUP_LOOP testexpr returns POP_TOP POP_BLOCK COME_FROM_LOOP withasstmt ::= expr SETUP_WITH store suite_stmts_opt POP_BLOCK LOAD_CONST COME_FROM_WITH WITH_CLEANUP END_FINALLY withstmt ::= expr SETUP_WITH POP_TOP suite_stmts_opt POP_BLOCK LOAD_CONST COME_FROM_WITH WITH_CLEANUP END_FINALLY + + # lc_body ::= LOAD_FAST expr LIST_APPEND + # lc_body ::= LOAD_NAME expr LIST_APPEND + # lc_body ::= expr LIST_APPEND + # list_comp ::= BUILD_LIST_0 list_iter + # list_for ::= expr FOR_ITER store list_iter jb_or_c + # list_if ::= expr jmp_false list_iter + # list_if ::= expr jmp_false_then list_iter + # list_if_not ::= expr jmp_true list_iter + # list_iter ::= list_if JUMP_BACK + # list_iter ::= list_if JUMP_BACK _come_froms POP_TOP + # list_iter ::= list_if_not + # load_closure ::= BUILD_TUPLE_0 + # load_genexpr ::= BUILD_TUPLE_1 LOAD_GENEXPR LOAD_STR + ########################################################################################## iflaststmtl ::= testexpr c_stmts_opt JUMP_BACK COME_FROM_LOOP diff --git a/uncompyle6/parsers/parse31.py b/uncompyle6/parsers/parse31.py index 5e5b681c..642bd757 100644 --- a/uncompyle6/parsers/parse31.py +++ b/uncompyle6/parsers/parse31.py @@ -36,6 +36,10 @@ class Python31Parser(Python32Parser): self.remove_rules(""" # DUP_TOP_TWO is DUP_TOPX in 3.1 and earlier subscript2 ::= expr expr DUP_TOP_TWO BINARY_SUBSCR + + # The were found using grammar coverage + list_if ::= expr jmp_false list_iter COME_FROM + list_if_not ::= expr jmp_true list_iter COME_FROM """) def customize_grammar_rules(self, tokens, customize):