From e6e60cb49d3bbc157aa3b5473220b18d31b90793 Mon Sep 17 00:00:00 2001 From: rocky Date: Wed, 17 Apr 2019 15:44:33 -0400 Subject: [PATCH] 3.6 Chained compare --- test/bytecode_2.6/01_triple_compare.pyc | Bin 452 -> 0 bytes test/bytecode_2.6_run/01_triple_compare.pyc | Bin 0 -> 482 bytes test/bytecode_2.7/01_triple_compare.pyc | Bin 446 -> 0 bytes test/bytecode_2.7_run/01_triple_compare.pyc | Bin 0 -> 474 bytes test/bytecode_3.2/01_triple_compare.pyc | Bin 471 -> 0 bytes test/bytecode_3.2_run/01_triple_compare.pyc | Bin 0 -> 499 bytes test/bytecode_3.3/01_triple_compare.pyc | Bin 500 -> 0 bytes test/bytecode_3.3_run/01_triple_compare.pyc | Bin 0 -> 528 bytes test/bytecode_3.6_run/01_triple_compare.pyc | Bin 0 -> 386 bytes test/simple_source/bug33/01_triple_compare.py | 5 ++++- uncompyle6/parsers/parse36.py | 2 ++ 11 files changed, 6 insertions(+), 1 deletion(-) delete mode 100644 test/bytecode_2.6/01_triple_compare.pyc create mode 100644 test/bytecode_2.6_run/01_triple_compare.pyc delete mode 100644 test/bytecode_2.7/01_triple_compare.pyc create mode 100644 test/bytecode_2.7_run/01_triple_compare.pyc delete mode 100644 test/bytecode_3.2/01_triple_compare.pyc create mode 100644 test/bytecode_3.2_run/01_triple_compare.pyc delete mode 100644 test/bytecode_3.3/01_triple_compare.pyc create mode 100644 test/bytecode_3.3_run/01_triple_compare.pyc create mode 100644 test/bytecode_3.6_run/01_triple_compare.pyc diff --git a/test/bytecode_2.6/01_triple_compare.pyc b/test/bytecode_2.6/01_triple_compare.pyc deleted file mode 100644 index 788c954a3dff49d8a847d82e86898322ad52dba1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 452 zcmb7PV#f{Kx<0{>#_*S$02NY)TrQ1m_LP8vyl5w1E(01&xvyK}|-&NP^l)lA>MVH92-i z2X_khb diff --git a/test/bytecode_2.6_run/01_triple_compare.pyc b/test/bytecode_2.6_run/01_triple_compare.pyc new file mode 100644 index 0000000000000000000000000000000000000000..62768f9bbb6a7c8baeed224704c14c5183163cd9 GIT binary patch literal 482 zcmb7}{%{jUU`|jb+je&U%pA4H~$kIOUEEs}{lFYE&83F^mLl>a`7a-#-OQ~(H z5TFu7N-CxAeT- zloPLcrApBa8_)!f!0@za6nGh!2QCArfp_x|@jgVN9~5G#aEtIKc$hjTtyj9awN~3* V%%J|4m1bYnx@;?Xy^T1Ce*nR*Sa<*c literal 0 HcmV?d00001 diff --git a/test/bytecode_2.7/01_triple_compare.pyc b/test/bytecode_2.7/01_triple_compare.pyc deleted file mode 100644 index 7bbe2d2134c27279d2e6bac3f16200f1e1723b49..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 446 zcmb7=JP3jpk2$%!>`7QeQ9SO!UZj^$o2-Owx1~u1!K44!Kj2I( zTRa+=uaCUxyh-wXI(xia<|T%c(D#nYYk~p3fSiPY6__MDf#wQEg2Y}ziZ+KyMsE!> z`Qsgp-V4n1;0co=Q^%B13IZ1=KT!D#0tJ3z2s|GGGbu8~T^mP$n-LT%#lMG?u(zQu z{O(+3WTroKdrOUcVQWGkO>{~oU-0ImK{lmGw# diff --git a/test/bytecode_2.7_run/01_triple_compare.pyc b/test/bytecode_2.7_run/01_triple_compare.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a5d61b2f4758ce63429068280e0209266327e26a GIT binary patch literal 474 zcmb7#A7k9)8uMF_RYYS?yDGN~YV5D{O=2lEA- ziDm26!hD(JPv-xdeD91t-@fik=)Q#33o3jfXn+rZJ8A?N0fS^Iz#W2?K+Q^m6x*ml zC%t$EdaxE*+vv4h(3^j?AmLqrP9e{>$gC6uE{!lcO5F=dp3z=yvH)gzU^Bv9xF`p}C$G?OAz+_iQDxCueAQv5vd_B*?; z3%~uoWh=1su5K%W|FqT{N3nWXGOGV=%7d15V?t%`4hx>7U(QFE z-NDNO@0YLn()Ya-qod)^*XB8gofV_L!*Xv339truLcu^W=tV0A<{Tsk6cq=~Moxl^ zI`al(Z)=iw(0Pv_4|lzW!#4vNLz?t4EN2K>v`1L?Sndpg>7UT1pSI~KXK6yW78(J1 zh)75!^t-2LRH`X6xB5FJ%ae4vtP3Ta@itfE7ymk)jwhF*v6_x^Q`VVP7xjlf!OKEB z@tzf0iniH+I&cIqPeGHwtH3O988{1kScDP(Z{_LHLM%1L3V)0rGv}0Tw5jIS8r#hs T)PBQL@9WY?U#Q#d%!BwBy=Y(3 literal 0 HcmV?d00001 diff --git a/test/bytecode_3.3/01_triple_compare.pyc b/test/bytecode_3.3/01_triple_compare.pyc deleted file mode 100644 index 37563b20c4cc000e9f687b668f03ea9d8f740556..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 500 zcmb79O-lnY6nxpO-CF9wgCKb9B`4d`lOTSecdyte`S%gt-^uYd?p9fu*mG*_X I+Q%LwpLI=N6951J diff --git a/test/bytecode_3.3_run/01_triple_compare.pyc b/test/bytecode_3.3_run/01_triple_compare.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3e85ec9f8a43875b343133147ba015edbb62d724 GIT binary patch literal 528 zcmb7AO-lnY5S?VJTgxhV5WIWYldbe5h_r}3_OdrAgmsgaupe2HjUads5r2k%!@uWD zEZrXTV930E$(zZ%+0W#7^zr(&ia9_5dn-mh!*C^n#LeIx-~kB-#b6MX49o?{2#_=! zI7{3HXp zS5N&5o}9I{bzt5O?=kNUn+%78_m|JR&;$5_f92DBL2Xh34jkVg1?~w9z=s0W0rv~6 z0}l|k!QAp-t(@@QpF;fBn!n-UhHt%B!qiN)(_>@SswvAHBaW_KpW2;E9mUumuM V=9J|WIG^aOQoJk0`8pvAe*h@;QMdpA literal 0 HcmV?d00001 diff --git a/test/simple_source/bug33/01_triple_compare.py b/test/simple_source/bug33/01_triple_compare.py index 3efe6bef..6878e042 100644 --- a/test/simple_source/bug33/01_triple_compare.py +++ b/test/simple_source/bug33/01_triple_compare.py @@ -1,8 +1,11 @@ # In Python 3.3+ this uses grammar rule # compare_chained2 ::= expr COMPARE_OP RETURN_VALUE +# In Python 3.6 uses this uses grammar rule +# compare_chained2 ::= expr COMPARE_OP come_froms JUMP_FORWARD # Seen in Python 3.3 ipaddress.py +# RUNNABLE! def _is_valid_netmask(netmask): return 0 <= netmask <= 10 @@ -10,4 +13,4 @@ def _is_valid_netmask(netmask): # detections # See in 2.6.9 quopri.py ishex(): -'0' <= __file__ <= '9' or 'a' <= __file__ <= 'f' or 'A' <= __file__ <= 'F' +assert not '0' <= __file__ <= '9' or 'a' <= __file__ <= 'f' or 'A' <= __file__ <= 'F' diff --git a/uncompyle6/parsers/parse36.py b/uncompyle6/parsers/parse36.py index f702f012..0117c24e 100644 --- a/uncompyle6/parsers/parse36.py +++ b/uncompyle6/parsers/parse36.py @@ -133,6 +133,8 @@ class Python36Parser(Python35Parser): stmt ::= tryfinally_return_stmt tryfinally_return_stmt ::= SETUP_FINALLY suite_stmts_opt POP_BLOCK LOAD_CONST COME_FROM_FINALLY + + compare_chained2 ::= expr COMPARE_OP come_froms JUMP_FORWARD """ def customize_grammar_rules(self, tokens, customize):