From 1890aad660dbe18dd78939c6ad4ab54771a0dab0 Mon Sep 17 00:00:00 2001 From: rocky Date: Fri, 13 Apr 2018 07:26:32 -0400 Subject: [PATCH] Small 3.7 steps --- test/bytecode_3.6/01_call_function.pyc | Bin 1035 -> 1035 bytes test/bytecode_3.7/00_assign.pyc | Bin 0 -> 152 bytes test/bytecode_3.7/00_docstring.pyc | Bin 0 -> 1001 bytes test/bytecode_3.7/01_augmented_assign.pyc | Bin 0 -> 1162 bytes test/bytecode_3.7/01_boolean.pyc | Bin 0 -> 160 bytes test/bytecode_3.7/01_extended_arg.pyc | Bin 0 -> 138 bytes test/bytecode_3.7/01_map_unpack.pyc | Bin 0 -> 428 bytes test/bytecode_3.7/01_matrix_multiply.pyc | Bin 0 -> 188 bytes uncompyle6/parsers/parse37.py | 7 +++++++ uncompyle6/scanners/scanner3.py | 8 ++++---- uncompyle6/semantics/customize3.py | 7 +++++++ 11 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 test/bytecode_3.7/00_assign.pyc create mode 100644 test/bytecode_3.7/00_docstring.pyc create mode 100644 test/bytecode_3.7/01_augmented_assign.pyc create mode 100644 test/bytecode_3.7/01_boolean.pyc create mode 100644 test/bytecode_3.7/01_extended_arg.pyc create mode 100644 test/bytecode_3.7/01_map_unpack.pyc create mode 100644 test/bytecode_3.7/01_matrix_multiply.pyc diff --git a/test/bytecode_3.6/01_call_function.pyc b/test/bytecode_3.6/01_call_function.pyc index f3d0e595da84f53b25aca2b4459e1a8d9f618846..c9642bb1a9ef16310d9680932090288309e36b4b 100644 GIT binary patch delta 16 XcmeC?=;mNI=H=!3uX$o4I|~Z{Bfg`kg58=YqU?b5V-N=h7=a82ATAaF5-AK(3@MCJj44b}Oeu`P44TZhSp4$y zQvEV@m>57j#>88UNw*l2S27f_0@Z_wUkb&Uxdl0?@x}S2Mail9#U;5V#rg&Y@rlL7 dndy0Y1(mlrY;yBcN^?@}SU@&`2o^>bMgYL;A~65} literal 0 HcmV?d00001 diff --git a/test/bytecode_3.7/00_docstring.pyc b/test/bytecode_3.7/00_docstring.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2c80e86ac37a930c73112f596c5d95304eee5d62 GIT binary patch literal 1001 zcmah{!H&}~5OtgGZmG2YFv=d%pptF(gjTcy?S%vC0XS8aEU)dffh3M>XMv)<@gZFK z2F^%)L$CY=C&q3`3o3LX+w+|9^YhF+J3sFcw6F2^*|#&`$lpEsPo5{2`;7E)X{Xa0VgO>|wlhxGRZ4ItX?Qvd4e&SD|q0;Z~zp4hz2s!EEa;dNSG zN>k_7^i!7QQjCWKVAjf_vIri>KJ@<;Up;6leuCaK?yS!+&5Bd%yHmS9(C*h>yZFZU WJ=1+sC{gEf;(OY4Plt4aZtx4R7UUoR literal 0 HcmV?d00001 diff --git a/test/bytecode_3.7/01_augmented_assign.pyc b/test/bytecode_3.7/01_augmented_assign.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3efcb3bcea40c7b267b57b85fda383af693766e4 GIT binary patch literal 1162 zcmZuv&2G~`5Z+zeiQ_nFE>u+NVQ(l!O@K=&s!A(^+KmW$!$04@JT z36UfqKqbAVU#MgOlU85>18au_%=qUEzgv1%#?m(D64lZfSb+_;WDeON(%B^z*(0)I z7>q5$?UB3DT^;gOS^ZY#x&yj1&z`f^JuJId%Vg~yttaaPhFxMGz(NO@O-7DHhLI3G zu#pv33?g4y@Rb4TFF!(6I@k0y`EVj!WNMfDE9P0?AydEHTrsV{hx$!J`adWo-|44= zQv$V{2GkdE2V)!K+9KXOB@%lPu1x|j@MS|bzmlMd9ogF5AmE|-I6)>{u%UU4Q!Tmq z+_3-oe5=Q#y(ZT10=*|sLope|kZ6#h$n$8Bbh0UrQyKLmki4(b*z;DB!myFGq7AH^A%d|BWNP=wF>lj6YNNt+HG3U=qFL;d=CG%@+i*65SDZ9<~r7S_x=kj zX#b@tZn_}MrK*X(y;fAiP^P^wEd2MAL`N~aQ7Tmh6$L#j=(un`i}3^s3tizTkqki9 zF*9J}Q9(!O&I@{8R793RBIiYK`zv=1lo#$EKA6cE_Dz((MX-s>Y-&??`7w{S@Ox;l c+v^S*^I3&9@wA1yCMruanilh^>$H&j4^QI?&;S4c literal 0 HcmV?d00001 diff --git a/test/bytecode_3.7/01_boolean.pyc b/test/bytecode_3.7/01_boolean.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9e1ae24f3029846202e7b5d39bb6fc21baeb46a5 GIT binary patch literal 160 zcmZ?d<>g`kf;zXX2!0^_7{q}AMj*ohh>JylL<&PbTM8p1kS^c@(@en(n#?ajYF+{{ zgWpPqB4!|sAb#oU=@)0_7UZPH7w4B2C8z4=7o-*?mSpDV#pmRwXC~_#7{({%=jWs* a=IIqw-r}&y%}*)KNwou+Sg`kg58=YqWXdKV-N=h7=a82ATH(r5~&PDEGZ1Z44RC7nvAzN;^WgYb5i5u zS27ea0cF9&FSX*#+ybCzaeir0a;kn(X}YnQzJXzUYDGzEUP@|8d}2|$UP0w84x8Nk Ql+v73JCF^em IFeIOT0f9GIh5!Hn literal 0 HcmV?d00001 diff --git a/test/bytecode_3.7/01_matrix_multiply.pyc b/test/bytecode_3.7/01_matrix_multiply.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1a5b854b8bacc28f1757faec48fbe6033fd0cdff GIT binary patch literal 188 zcmZ?d<>g`k0@jxcqE-Xx#~=<2FasG5KwPW{WZ(taon^;nmSrMOGnp2WlkW;BwP= 3.7: varargs_ops.add(self.opc.CALL_METHOD) if self.version >= 3.5: varargs_ops |= set([self.opc.BUILD_SET_UNPACK, @@ -179,7 +179,7 @@ class Scanner3(Scanner): bytecode = self.build_instructions(co) - # show_asm = 'after' + # show_asm = 'both' if show_asm in ('both', 'before'): for instr in bytecode.get_instructions(co): print(instr.disassemble()) @@ -347,9 +347,9 @@ class Scanner3(Scanner): else: opname = '%s_%d' % (opname, pos_args) - elif self.is_pypy and opname in ('CALL_METHOD', 'JUMP_IF_NOT_DEBUG'): + elif self.is_pypy and opname == 'JUMP_IF_NOT_DEBUG': # The value in the dict is in special cases in semantic actions, such - # as CALL_FUNCTION. The value is not used in these cases, so we put + # as JUMP_IF_NOT_DEBUG. The value is not used in these cases, so we put # in arbitrary value 0. customize[opname] = 0 elif opname == 'UNPACK_EX': diff --git a/uncompyle6/semantics/customize3.py b/uncompyle6/semantics/customize3.py index 1aa106ba..69defdc6 100644 --- a/uncompyle6/semantics/customize3.py +++ b/uncompyle6/semantics/customize3.py @@ -879,6 +879,13 @@ def customize_for_version3(self, version): self.prune() return self.n_return_closure = return_closure + + if version >= 3.7: + PRECEDENCE['attribute37'] = 2 + TABLE_DIRECT.update({ + 'attribute37': ( '%c.%[1]{pattr}', 0 ), + }) + pass pass # version >= 3.6 pass # version >= 3.4 return