|
57 | 57 | "list_unpack": 38, # *args
|
58 | 58 | "yield_from": 38,
|
59 | 59 | "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? |
60 | 62 |
|
61 | 63 | "_lambda_body": 30,
|
62 | 64 | "lambda_body": 32, # lambda ... : lambda_body
|
|
329 | 331 | # When a statement contains only a named_expr (:=)
|
330 | 332 | # the named_expr should have parenthesis around it.
|
331 | 333 | (0, "expr", PRECEDENCE["named_expr"] - 1)
|
332 |
| - ), |
| 334 | + ), |
333 | 335 |
|
334 | 336 | # Note: Python 3.8+ changes this
|
335 | 337 | "for": ("%|for %c in %c:\n%+%c%-\n\n", (3, "store"), (1, "expr"), (4, "for_block")),
|
|
384 | 386 | "ifelsestmtc": ("%|if %c:\n%+%c%-%|else:\n%+%c%-", 0, 1, 3),
|
385 | 387 | "ifelsestmtl": ("%|if %c:\n%+%c%-%|else:\n%+%c%-", 0, 1, 3),
|
386 | 388 |
|
387 |
| - # This is created only via transformation |
| 389 | + # This is created only via transformation. |
388 | 390 | "ifelifstmt": ("%|if %c:\n%+%c%-%c", 0, 1, 3), # "testexpr" or "testexpr_then"
|
389 | 391 |
|
390 | 392 | "ifelsestmtr": ("%|if %c:\n%+%c%-%|else:\n%+%c%-", 0, 1, 2),
|
|
426 | 428 | "list_if": (" if %p%c", (0, "expr", 27), 2),
|
427 | 429 | "list_if_not": (" if not %p%c", (0, "expr", PRECEDENCE["unary_not"]), 2),
|
428 | 430 |
|
429 |
| - "mkfuncdeco": ("%|@%c\n%c", 0, 1), |
| 431 | + "mkfuncdeco": ("%|@%c\n%c", (0, "expr"), 1), |
430 | 432 | # A custom rule in n_function def distinguishes whether to call this or
|
431 | 433 | # function_def_async
|
432 |
| - "mkfuncdeco0": ("%|def %c\n", 0), |
| 434 | + "mkfuncdeco0": ("%|def %c\n", (0, "mkfunc")), |
433 | 435 |
|
434 | 436 | # In cases where we desire an explict new line.
|
435 | 437 | # After docstrings which are followed by a "def" is
|
|
560 | 562 | # "yield": ( "yield %c", 0),
|
561 | 563 |
|
562 | 564 | }
|
| 565 | +# fmt: on |
563 | 566 |
|
564 | 567 |
|
565 | 568 | MAP_DIRECT = (TABLE_DIRECT,)
|
|
572 | 575 | "store": MAP_R,
|
573 | 576 | }
|
574 | 577 |
|
575 |
| -ASSIGN_TUPLE_PARAM = lambda param_name: SyntaxTree( |
| 578 | +ASSIGN_TUPLE_PARAM = lambda param_name: SyntaxTree( # noqa |
576 | 579 | "expr", [Token("LOAD_FAST", pattr=param_name)]
|
577 | 580 | )
|
578 | 581 |
|
|
0 commit comments