From 1fff81736fab1ef62c30a612fa31e129f9b91c4d Mon Sep 17 00:00:00 2001 From: rocky Date: Sun, 26 Jan 2020 07:37:36 -0500 Subject: [PATCH] parser if-stmt restriction thing & 3.x exclusions --- test/stdlib/3.4-exclude.sh | 1 + test/stdlib/3.8-exclude.sh | 9 ++++++++- uncompyle6/parsers/parse3.py | 4 ++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/test/stdlib/3.4-exclude.sh b/test/stdlib/3.4-exclude.sh index ef31723c..b8322022 100644 --- a/test/stdlib/3.4-exclude.sh +++ b/test/stdlib/3.4-exclude.sh @@ -2,6 +2,7 @@ SKIP_TESTS=( [test_buffer.py]=1 # FIXME: Works on c90ff51 [test_decorators.py]=1 # FIXME: Works on c90ff51 [test_faulthandler.py]=1 # FIXME: too long to run 20 seconds. Works on c90ff51 + [test_finalization.py]=1 # Works on c90ff51 [test_decimal.py]=1 # FIXME: Works on c90ff51 [test_marshal.py]=1 # FIXME: Works on c90ff51 [test_math.py]=1 # FIXME: Works on c90ff51 diff --git a/test/stdlib/3.8-exclude.sh b/test/stdlib/3.8-exclude.sh index a52a42aa..a3dcaf3a 100644 --- a/test/stdlib/3.8-exclude.sh +++ b/test/stdlib/3.8-exclude.sh @@ -4,10 +4,12 @@ SKIP_TESTS=( [test_asdl_parser.py]=1 # it fails on its own [test_ast.py]=1 # Depends on comments in code [test_atexit.py]=1 # The atexit test looks for specific comments in error lines + [test_baseexception.py]=1 # [test_bdb.py]=1 # [test_buffer.py]=1 # parse error [test_builtin.py]=1 # parse error + [test_clinic.py]=1 # it fails on its own [test_cmath.py]=1 # test assertion failure [test_cmd_line.py]=1 # Interactive? @@ -26,7 +28,8 @@ SKIP_TESTS=( [test_crypt.py]=1 # Parse error [test_ctypes.py]=1 # it fails on its own [test_curses.py]=1 # Parse error - [test_dataclasses.py]=1 # parse error + + [test_dataclasses.py]=1 # test assertion errors [test_datetime.py]=1 # Takes too long [test_dbm_gnu.py]=1 # Takes too long [test_dbm_ndbm.py]=1 # it fails on its own @@ -36,9 +39,11 @@ SKIP_TESTS=( [test_dictcomps.py]=1 # Bad semantics - Investigate [test_dis.py]=1 # We change line numbers - duh! [test_docxmlrpc.py]=1 + [test_exceptions.py]=1 # parse error [test_enumerate.py]=1 # [test_enum.py]=1 # + [test_faulthandler.py]=1 # takes too long [test_fcntl.py]=1 [test_fileinput.py]=1 @@ -48,12 +53,14 @@ SKIP_TESTS=( [test_fstring.py]=1 # Investigate [test_ftplib.py]=1 [test_functools.py]=1 + [test_gdb.py]=1 # it fails on its own [test_generators.py]=1 # improper decompile of assert i < n and (n-i) % 3 == 0 [test_glob.py]=1 # [test_grammar.py]=1 [test_grp.py]=1 # Doesn't terminate (killed) [test_gzip.py]=1 # parse error + [test_hashlib.py]=1 # test assert failures [test_httplib.py]=1 # parse error [test_http_cookiejar.py]=1 diff --git a/uncompyle6/parsers/parse3.py b/uncompyle6/parsers/parse3.py index f11a0981..d8de1a2c 100644 --- a/uncompyle6/parsers/parse3.py +++ b/uncompyle6/parsers/parse3.py @@ -157,15 +157,15 @@ class Python3Parser(PythonParser): testtrue ::= expr jmp_true _ifstmts_jump ::= return_if_stmts - _ifstmts_jump ::= stmts_opt come_froms + _ifstmts_jump ::= stmts _come_froms _ifstmts_jumpl ::= c_stmts_opt come_froms iflaststmt ::= testexpr stmts_opt JUMP_ABSOLUTE + iflaststmt ::= testexpr _ifstmts_jumpl # ifstmts where we are in a loop _ifstmts_jumpl ::= _ifstmts_jump iflaststmtl ::= testexpr c_stmts_opt JUMP_BACK - iflaststmtl ::= testexpr _ifstmts_jumpl # These are used to keep parse tree indices the same jump_forward_else ::= JUMP_FORWARD ELSE