Commit Graph

1111 Commits

Author SHA1 Message Date
rocky
514b0d0b0c Sync from decompyle3 2022-11-06 01:24:28 -05:00
James Hilliard
e08324d85c Replace remaining self.opc with token.opc 2022-11-05 19:39:31 -04:00
rocky
207dc0b506 opc field in while1 reduction is off of token...
not self (parse)
2022-11-05 19:20:16 -04:00
James Hilliard
ab508e1ec9 Fix ImportError: cannot import name PYTHON_VERSION 2022-11-05 17:17:24 -04:00
rocky
8843686b49 Add generator expression Python 3.0 .. 3.2 2022-11-05 10:31:00 -04:00
rocky
9d1cf50c5e Add generator expression Python 3.0 .. 3.2 2022-11-05 10:15:45 -04:00
rocky
57d2386cc3 Fix another 3.0 list comprehension parse 2022-11-05 00:27:05 -04:00
rocky
4959c76694 More 3.0 list comprehension bug fixes 2022-11-04 02:05:34 -04:00
rocky
d0a98bdbc6 Correct 3.0 list comprehension parsing 2022-11-04 00:42:50 -04:00
rocky
5b3ea47bac Correct long-literals for Python 2.7 2022-10-16 19:33:51 -04:00
rocky
1819fc8944 ifelsetmt - jump back is only allowed inside loops 2022-10-16 17:50:58 -04:00
rocky
976705fc0a
Add: Python 2.7: ifelsestmtc 2022-10-10 04:30:48 +02:00
rocky
2264ccb1d5 A partial reduce-action sync with decompyle3
Start us add _check prefixes and _invalid to the end of check methods
2022-09-30 02:45:52 -04:00
rocky
ad1fa98870 Detect Python 2.7 weird "for-block" bytecode
It has an unnecessary JUMP_ABSOLUTE to a JUMP_LOOP

Fixes #408
2022-09-27 08:58:35 -04:00
rocky
a68f440d6f Sync with decompyle3
Better PyPy 3.7 tolerance
2022-09-17 01:59:42 -04:00
rocky
4260deea11 Tidy ifelsemstmt check 2022-08-29 05:46:46 -04:00
R. Bernstein
200250df56
Merge pull request #406 from tangboxuan/master
Fix offset of extended argument instruction
2022-08-24 05:51:41 -04:00
rocky
765b0149ea iftstmt reduce rule for 2.6:
In ifsmt there can be a JUMP_ABSOLUTE right before the endif and a jump
the endif doesn't fall through to the place after the endif.
2022-08-24 05:33:22 -04:00
Bo Xuan
2f3b5e53d4
Add test case 2022-08-24 16:19:39 +08:00
rocky
71b1446c9c Push reducechecks from 2.7 into 2.6
Some adaption is needed. These rules may also help earlier 2.x Python as well
2022-08-23 21:36:55 -04:00
rocky
14aa0ce8f0 sort a list 2022-08-23 20:17:06 -04:00
rocky
21b4d52a77 Correct 2.6 erroneous ifelse detection 2022-08-23 16:50:50 -04:00
Bo Xuan
81633b3c1c
Fix offset of extended argument instruction 2022-08-23 14:18:31 +08:00
rocky
610f2c827c Remove 3.6-specific iflastsmt reduce check
Fixes #344
2022-07-07 06:54:05 -04:00
rocky
5a4136a7f6 Some limited support for 3.8 "=" specifier 2022-07-06 13:00:52 -04:00
rocky
cc4ea47d24 Use ifelsetmt reduction rule on 2.7 2022-07-04 07:56:44 -04:00
rocky
85ba8352ba Port over some recent decompyle3 3.8 fixes 2022-06-26 04:26:15 -04:00
rocky
7f798541f0 Python 3.8 while and whileTrue loops 2022-06-16 15:42:51 -04:00
rocky
7fb483c566 Sync up with decompile3's 3.8 try/else handling 2022-06-08 12:49:23 -04:00
rocky
5c29b9a5e5 remove \n in lambda; 2.6 grammar cleanup 2022-05-14 20:28:24 -04:00
rocky
9b80663529 3.6 async hacking 2022-05-07 07:01:39 -04:00
rocky
dae00e9b0b More 3.6 "async for" 2022-05-06 15:15:05 -04:00
rocky
cca015c5d6 Use LOAD_ARG in 3.6 2022-05-06 12:53:55 -04:00
rocky
cc47d61efa Better 3.6 set comprehensions 2022-05-06 07:30:56 -04:00
rocky
92b8d9c508 Grammar lint adjustments 2022-05-06 03:02:30 -04:00
rocky
f5043408ec Start rolling in LOAD_ARG for 3.7+ 2022-05-06 02:41:02 -04:00
rocky
8576117d00 Fix More 3.6 async parsing
... all from 3.6 test_coroutines.py.

More bugs remain
2022-05-05 07:36:06 -04:00
rocky
c5efec1e6f Fox some 3.6 async_forelse parsing 2022-05-05 07:09:39 -04:00
rocky
f9a1f6fcd9 Sync 3.7 async_forelse with decompyle3 2022-05-05 06:47:49 -04:00
rocky
c9f33edde4 Handle 3.6 "async for" better 2022-05-04 19:21:07 -04:00
rocky
9dd4a53ff8 Fix 3.6 async parsing 2022-05-04 04:27:38 -04:00
rocky
e94e9379c0 Bang on version 1.0-1.4 Python 2022-05-02 22:03:52 -04:00
rocky
eba0d37d0f Improve Python 1.x decompiling
Still has bugs, but is much better.
2022-04-30 05:54:22 -04:00
rocky
8e5faa933f Handle long 2.x bytecode literals more efficiently 2022-04-27 13:47:56 -04:00
rocky
c25fa61e33 Start handling BUILD_MAP (a class of dict) 2022-04-26 15:37:42 -04:00
rocky
bf58fb9cf2 WIP - extend fast long-literals into older Python3 2022-04-25 08:06:46 -04:00
rocky
371138cfbc handle long literal constants faster 2022-04-24 13:11:20 -04:00
rocky
433d7003e0 Add "transfrormd_by" param to SyntaxTree
This aligns code more with decompyle3
2022-04-21 05:25:14 -04:00
rocky
c88d9de316 Correct 3.7 "impor"t and "from .. import" 2022-04-20 20:03:28 -04:00
rocky
a1fe069c8c Handle walrus operator
Or rather set precedence on call_stmt and expr_stmt

Adjust pytest test_single_compile so it works now
2022-04-12 05:21:13 -04:00