@@ -45,6 +45,8 @@ let callExpr expr =
45
45
| Pexp_try _ | Pexp_while _ | Pexp_for _ | Pexp_ifthenelse _ );
46
46
} ->
47
47
Parenthesized
48
+ | _ when ParsetreeViewer. hasAwaitAttribute expr.pexp_attributes ->
49
+ Parenthesized
48
50
| _ -> Nothing )
49
51
50
52
let structureExpr expr =
@@ -96,6 +98,8 @@ let unaryExprOperand expr =
96
98
| Pexp_try _ | Pexp_while _ | Pexp_for _ | Pexp_ifthenelse _ );
97
99
} ->
98
100
Parenthesized
101
+ | _ when ParsetreeViewer. hasAwaitAttribute expr.pexp_attributes ->
102
+ Parenthesized
99
103
| _ -> Nothing )
100
104
101
105
let binaryExprOperand ~isLhs expr =
@@ -120,6 +124,8 @@ let binaryExprOperand ~isLhs expr =
120
124
| expr when ParsetreeViewer. isBinaryExpression expr -> Parenthesized
121
125
| expr when ParsetreeViewer. isTernaryExpr expr -> Parenthesized
122
126
| {pexp_desc = Pexp_lazy _ | Pexp_assert _ } when isLhs -> Parenthesized
127
+ | _ when ParsetreeViewer. hasAwaitAttribute expr.pexp_attributes ->
128
+ Parenthesized
123
129
| {Parsetree. pexp_attributes = attrs } ->
124
130
if ParsetreeViewer. hasPrintableAttributes attrs then Parenthesized
125
131
else Nothing )
@@ -196,6 +202,8 @@ let lazyOrAssertExprRhs expr =
196
202
| Pexp_try _ | Pexp_while _ | Pexp_for _ | Pexp_ifthenelse _ );
197
203
} ->
198
204
Parenthesized
205
+ | _ when ParsetreeViewer. hasAwaitAttribute expr.pexp_attributes ->
206
+ Parenthesized
199
207
| _ -> Nothing )
200
208
201
209
let isNegativeConstant constant =
@@ -240,6 +248,8 @@ let fieldExpr expr =
240
248
| Pexp_ifthenelse _ );
241
249
} ->
242
250
Parenthesized
251
+ | _ when ParsetreeViewer. hasAwaitAttribute expr.pexp_attributes ->
252
+ Parenthesized
243
253
| _ -> Nothing )
244
254
245
255
let setFieldExprRhs expr =
@@ -302,6 +312,8 @@ let jsxPropExpr expr =
302
312
}
303
313
when startsWithMinus x ->
304
314
Parenthesized
315
+ | _ when ParsetreeViewer. hasAwaitAttribute expr.pexp_attributes ->
316
+ Parenthesized
305
317
| {
306
318
Parsetree. pexp_desc =
307
319
( Pexp_ident _ | Pexp_constant _ | Pexp_field _ | Pexp_construct _
@@ -338,6 +350,8 @@ let jsxChildExpr expr =
338
350
}
339
351
when startsWithMinus x ->
340
352
Parenthesized
353
+ | _ when ParsetreeViewer. hasAwaitAttribute expr.pexp_attributes ->
354
+ Parenthesized
341
355
| {
342
356
Parsetree. pexp_desc =
343
357
( Pexp_ident _ | Pexp_constant _ | Pexp_field _ | Pexp_construct _
0 commit comments