@@ -45,6 +45,8 @@ let callExpr expr =
4545 | Pexp_try _ | Pexp_while _ | Pexp_for _ | Pexp_ifthenelse _ );
4646 } ->
4747 Parenthesized
48+ | _ when ParsetreeViewer. hasAwaitAttribute expr.pexp_attributes ->
49+ Parenthesized
4850 | _ -> Nothing )
4951
5052let structureExpr expr =
@@ -96,6 +98,8 @@ let unaryExprOperand expr =
9698 | Pexp_try _ | Pexp_while _ | Pexp_for _ | Pexp_ifthenelse _ );
9799 } ->
98100 Parenthesized
101+ | _ when ParsetreeViewer. hasAwaitAttribute expr.pexp_attributes ->
102+ Parenthesized
99103 | _ -> Nothing )
100104
101105let binaryExprOperand ~isLhs expr =
@@ -120,6 +124,8 @@ let binaryExprOperand ~isLhs expr =
120124 | expr when ParsetreeViewer. isBinaryExpression expr -> Parenthesized
121125 | expr when ParsetreeViewer. isTernaryExpr expr -> Parenthesized
122126 | {pexp_desc = Pexp_lazy _ | Pexp_assert _ } when isLhs -> Parenthesized
127+ | _ when ParsetreeViewer. hasAwaitAttribute expr.pexp_attributes ->
128+ Parenthesized
123129 | {Parsetree. pexp_attributes = attrs } ->
124130 if ParsetreeViewer. hasPrintableAttributes attrs then Parenthesized
125131 else Nothing )
@@ -196,6 +202,8 @@ let lazyOrAssertExprRhs expr =
196202 | Pexp_try _ | Pexp_while _ | Pexp_for _ | Pexp_ifthenelse _ );
197203 } ->
198204 Parenthesized
205+ | _ when ParsetreeViewer. hasAwaitAttribute expr.pexp_attributes ->
206+ Parenthesized
199207 | _ -> Nothing )
200208
201209let isNegativeConstant constant =
@@ -240,6 +248,8 @@ let fieldExpr expr =
240248 | Pexp_ifthenelse _ );
241249 } ->
242250 Parenthesized
251+ | _ when ParsetreeViewer. hasAwaitAttribute expr.pexp_attributes ->
252+ Parenthesized
243253 | _ -> Nothing )
244254
245255let setFieldExprRhs expr =
@@ -302,6 +312,8 @@ let jsxPropExpr expr =
302312 }
303313 when startsWithMinus x ->
304314 Parenthesized
315+ | _ when ParsetreeViewer. hasAwaitAttribute expr.pexp_attributes ->
316+ Parenthesized
305317 | {
306318 Parsetree. pexp_desc =
307319 ( Pexp_ident _ | Pexp_constant _ | Pexp_field _ | Pexp_construct _
@@ -338,6 +350,8 @@ let jsxChildExpr expr =
338350 }
339351 when startsWithMinus x ->
340352 Parenthesized
353+ | _ when ParsetreeViewer. hasAwaitAttribute expr.pexp_attributes ->
354+ Parenthesized
341355 | {
342356 Parsetree. pexp_desc =
343357 ( Pexp_ident _ | Pexp_constant _ | Pexp_field _ | Pexp_construct _
0 commit comments