Skip to content

Commit acdf777

Browse files
committed
Sync with decompile3
1 parent 404c46c commit acdf777

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

uncompyle6/semantics/consts.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@
5757
"list_unpack": 38, # *args
5858
"yield_from": 38,
5959
"tuple_list_starred": 38, # *x, *y, *z - about at the level of yield?
60+
"unpack": 38, # A guess. Used in "async with ... as ...
61+
# This might also get used in tuple assignment?
6062

6163
"_lambda_body": 30,
6264
"lambda_body": 32, # lambda ... : lambda_body
@@ -329,7 +331,7 @@
329331
# When a statement contains only a named_expr (:=)
330332
# the named_expr should have parenthesis around it.
331333
(0, "expr", PRECEDENCE["named_expr"] - 1)
332-
),
334+
),
333335

334336
# Note: Python 3.8+ changes this
335337
"for": ("%|for %c in %c:\n%+%c%-\n\n", (3, "store"), (1, "expr"), (4, "for_block")),
@@ -384,7 +386,7 @@
384386
"ifelsestmtc": ("%|if %c:\n%+%c%-%|else:\n%+%c%-", 0, 1, 3),
385387
"ifelsestmtl": ("%|if %c:\n%+%c%-%|else:\n%+%c%-", 0, 1, 3),
386388

387-
# This is created only via transformation
389+
# This is created only via transformation.
388390
"ifelifstmt": ("%|if %c:\n%+%c%-%c", 0, 1, 3), # "testexpr" or "testexpr_then"
389391

390392
"ifelsestmtr": ("%|if %c:\n%+%c%-%|else:\n%+%c%-", 0, 1, 2),
@@ -426,10 +428,10 @@
426428
"list_if": (" if %p%c", (0, "expr", 27), 2),
427429
"list_if_not": (" if not %p%c", (0, "expr", PRECEDENCE["unary_not"]), 2),
428430

429-
"mkfuncdeco": ("%|@%c\n%c", 0, 1),
431+
"mkfuncdeco": ("%|@%c\n%c", (0, "expr"), 1),
430432
# A custom rule in n_function def distinguishes whether to call this or
431433
# function_def_async
432-
"mkfuncdeco0": ("%|def %c\n", 0),
434+
"mkfuncdeco0": ("%|def %c\n", (0, "mkfunc")),
433435

434436
# In cases where we desire an explict new line.
435437
# After docstrings which are followed by a "def" is
@@ -560,6 +562,7 @@
560562
# "yield": ( "yield %c", 0),
561563

562564
}
565+
# fmt: on
563566

564567

565568
MAP_DIRECT = (TABLE_DIRECT,)
@@ -572,7 +575,7 @@
572575
"store": MAP_R,
573576
}
574577

575-
ASSIGN_TUPLE_PARAM = lambda param_name: SyntaxTree(
578+
ASSIGN_TUPLE_PARAM = lambda param_name: SyntaxTree( # noqa
576579
"expr", [Token("LOAD_FAST", pattr=param_name)]
577580
)
578581

0 commit comments

Comments
 (0)