Skip to content

Commit b4db22d

Browse files
committed
Narrow precedence for call statement
1 parent 8879708 commit b4db22d

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

uncompyle6/semantics/consts.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,10 @@
327327
# For compatibility with older Python, we'll use "%" instead of
328328
# a format string.
329329
"string_at_beginning": ('%|"%%s" %% %c\n', 0),
330-
"call_stmt": ("%|%p\n", (0, 200)),
330+
"call_stmt": ( "%|%p\n",
331+
# When a call statement contains only a named_expr (:=)
332+
# the named_expr should have parenthesis around it.
333+
(0, PRECEDENCE["named_expr"]-1)),
331334
"break": ("%|break\n",),
332335
"continue": ("%|continue\n",),
333336
"raise_stmt0": ("%|raise\n",),

uncompyle6/semantics/customize37.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,11 @@ def customize_for_version37(self, version):
149149
(1, "store"), (0, "get_aiter"), (3, "list_iter"),
150150
),
151151

152+
"list_afor": (
153+
" async for %[1]{%c} in %c%[1]{%c}",
154+
(1, "store"), (0, "get_aiter"), (3, "list_iter"),
155+
),
156+
152157
"list_if37": (" if %p%c", (0, 27), 1),
153158
"list_if37_not": (" if not %p%c", (0, 27), 1),
154159
"testfalse_not_or": ("not %c or %c", (0, "expr"), (2, "expr")),

0 commit comments

Comments
 (0)