Commit Graph

511 Commits

Author SHA1 Message Date
rocky
2b8406e7a8 mark "psuedo ops" 2024-02-25 06:08:06 -05:00
rocky
8c3143ce4c Sync with decompyle3 2024-02-17 20:14:30 -05:00
rocky
f1bf86088e Sync with decompyle3 2024-02-10 21:06:05 -05:00
rocky
c8b92e2275 Add needed newline separating abstract tree 2024-02-10 20:04:18 -05:00
rocky
f605f859ae Partial sync with decompyle3 2024-02-05 16:57:59 -05:00
rocky
f7436a4ff2 More lint 2024-02-05 16:17:48 -05:00
rocky
42ed183dbb Fix imports 2024-02-04 12:36:08 -05:00
rocky
db6c7159f8 lint 2024-02-03 14:47:08 -05:00
rocky
d249c522a7 Fix up linemap option 2024-02-03 12:37:48 -05:00
rocky
dcc9d1a571 Fix spelling via "codespell" 2023-12-17 10:52:32 -05:00
rocky
7ad0c37c62 Correct a couple of bugs...
We weren't distinguising relative imports from absolute imports.
Fixes #444

Picking out docstring was broken too.
2023-04-17 16:35:27 -04:00
rocky
d1911d2487 More lint 2022-11-27 04:14:46 -05:00
rocky
8c85260852 Lint-like changes from VSCode
Also allow 3.11 to run this
2022-09-21 08:29:06 -04:00
rocky
62b816c60b Correct a signature return 2022-09-21 02:08:08 -04:00
rocky
be9af85e16 Hande Python 3.5 make_function() semantic action
Fixes #409
2022-09-21 00:19:37 -04:00
rocky
5c29b9a5e5 remove \n in lambda; 2.6 grammar cleanup 2022-05-14 20:28:24 -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
8cdf741b62 Bugs in long-literal handlin
Move n_dict to n_actions and special case n_const_list.
Generalize build_collection out of 3.7+ and into all Pythons
2022-04-24 17:38:35 -04:00
rocky
e2ff909603 Split off (semantic) nonterminal print actions 2022-04-19 16:42:48 -04:00
rocky
3662f3e8c6 Fold in some decompile changes 2022-04-17 12:20:03 -04:00
rocky
f8ae674890 Split out comprehension code..
sync with decompile a little better
2022-04-17 10:52:56 -04:00
rocky
04510ac2f8 lambda formatting in f-string
In a formatted string using "lambda',  we should not add "\n".
For example in:
  f'{(lambda x:x)("8")!r}'

Adding a "\n" after "lambda x: x" will give an error message:
  SyntaxError: f-string expression part cannot include a backslash
2022-04-12 16:49:58 -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
rocky
9735453283 Small changes
test code for pysource and bump lastest testing Python versions
2022-04-01 03:11:59 -04:00
rocky
d366248b47 Some small variable-name changes 2022-03-04 04:47:38 -05:00
rocky
ce5207333f Remove TABLE_R0 - it hasn't been used in a while 2022-02-27 10:18:57 -05:00
rocky
f2a70a2758 Sync with decompyle3 for async "for"
More work is needed though
2022-01-18 15:25:51 -05:00
rocky
5b5fa310d9 Partial 3.8 async "for" fixes 2022-01-18 13:08:17 -05:00
rocky
88c0c03ee4 setcomprehension_walk3 -> closure_walk 2022-01-14 07:50:39 -05:00
rocky
15761acd0d Revise options processing. Sync with decompyle3
We should now handle passing assembly options or functions and
subroutines more properly.

The "%P" and "%p" specifiers now allow lists of nonterminals like "%c"
and "%C" do.

version was bumped because top-level main parameter args change slightly.
2022-01-09 04:11:09 -05:00
rocky
deea74b6a8 ret_expr -> return_expr
This matches Python's AST a little more closely
2022-01-03 21:56:07 -05:00
rocky
3d5b6f4654 return_lambda -> return_expr_lambda
Except those places in 2.6ish code where it is simple a fancy RETURN_VALUE
2022-01-01 21:45:51 -05:00
rocky
3234673422 mklambda -> lambda_body matches Python AST better
Note: we can't use "lambda" since that is a reserved word
2021-12-26 18:48:51 -05:00
rocky
30aad42aae Sync with other versions 2021-12-23 16:46:25 -05:00
rocky
a3bc9bb32b Add operator precedence to -T output 2021-12-23 16:11:25 -05:00
rocky
b3aaff0201 Sync pysource with decompyle3 2021-12-18 03:03:50 -05:00
rocky
16c900ff1d Propagate show_asm debug option down to functions 2021-12-17 06:07:18 -05:00
rocky
8094f3bb12 Remove PYTHON3 2021-11-03 03:00:43 -04:00
rocky
1bcd21a6f4 More version conversion bugs 2021-10-23 10:04:58 -04:00
rocky
c68b74a9c6 new dis - Python compisons involving tuples 2021-10-15 23:39:59 -04:00
rocky
cfbb25df3d Fix some small bugs 2021-07-08 05:40:43 -04:00
rocky
8eb4d6a576 Fix bit rot in fragments.py
build_ast() added a code argument
n_dict(): was out of sync with corresponding pysource routine
pysource.py: small doc typo
2020-09-04 19:30:48 -04:00
rocky
8879708da7 del_stmt -> delete to match Python AST better 2020-09-02 07:14:56 -04:00
rocky
71c17c4e53 Fragment api changed...
sync with pysource.
Simplify pysource a little
2020-08-23 19:27:52 -04:00
rocky
024a81c053 Fix condition sense in except_handler.py reduction 2020-07-23 11:03:43 -04:00
rocky
a215ee2f00 Use "co_consts" in docstring detection.
Note: this is an upheaval because we need to pass "code" or at least
"code.co_consts" to the docstring detection routine
2020-07-21 10:31:07 -04:00
rocky
0f80c38530 Better doc string detection
A bug in 2.7 test_descr.py revealed a problem with the way we were
detecting docstrings.

        __doc__ = DocDescr()

was getting confused with a docstring.

This program also reveals other bugs in 3.2+ but we'll deal with that
in another commit.
2020-07-19 20:31:50 -04:00
rocky
11be90758f Workaround bug detecting MAKE_FUNCTION docstrings 2020-06-26 07:17:31 -04:00
rocky
5a83c7c643 Simplify imports again using xdis 4.6.0 2020-05-19 00:53:53 -04:00
rocky
7fa851765d Regularize "or" so args are in 1..2 and ...
correct "return None" semantic action
2020-05-18 22:55:26 -04:00