Commit 921cab5
committed
vfmt: preserve parens around parenthesized function calls
parser fix (fixes #22652) unwraps a ParExpr wrapping a call's left, so
a call like (add)(2, 4) was parsed but vfmt could no longer see the parens
and rewrote it to add(2, 4) — defeating the regression test.
Add is_paren_wrapped_call flag on CallExpr, set by the parser when it
unwraps the ParExpr, and use it in fmt.call_expr to write '(' name ')'.1 parent 7a83f2e commit 921cab5
3 files changed
Lines changed: 14 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
940 | 940 | | |
941 | 941 | | |
942 | 942 | | |
| 943 | + | |
943 | 944 | | |
944 | 945 | | |
945 | 946 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2213 | 2213 | | |
2214 | 2214 | | |
2215 | 2215 | | |
| 2216 | + | |
| 2217 | + | |
2216 | 2218 | | |
2217 | 2219 | | |
2218 | 2220 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
882 | 882 | | |
883 | 883 | | |
884 | 884 | | |
885 | | - | |
886 | | - | |
887 | | - | |
888 | | - | |
889 | | - | |
890 | | - | |
891 | | - | |
892 | | - | |
893 | | - | |
894 | | - | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
895 | 896 | | |
896 | 897 | | |
897 | 898 | | |
| |||
0 commit comments