This repository was archived by the owner on Jun 15, 2023. It is now read-only.
File tree 4 files changed +28
-6
lines changed
4 files changed +28
-6
lines changed Original file line number Diff line number Diff line change 42
42
- Fix issue where the formatter would delete ` async ` in a function with labelled arguments.
43
43
- Fix several printing issues with ` async ` including an infinite loop https://github.com/rescript-lang/syntax/pull/680
44
44
- Fix issue where certain JSX expressions would be formatted differenctly in compiler 10.1.0-rc.1 https://github.com/rescript-lang/syntax/issues/675
45
+ - Fix issue where printing nested pipe discards await https://github.com/rescript-lang/syntax/issues/687
45
46
46
47
#### :eyeglasses : Spec Compliance
47
48
Original file line number Diff line number Diff line change @@ -3604,14 +3604,29 @@ and printBinaryExpression ~customLayout (expr : Parsetree.expression) cmtTbl =
3604
3604
| [] -> doc
3605
3605
| _ -> addParens doc
3606
3606
in
3607
+ let isAwait =
3608
+ ParsetreeViewer. hasAwaitAttribute expr.pexp_attributes
3609
+ in
3607
3610
let doc =
3608
- Doc. concat
3609
- [
3610
- leftPrinted;
3611
- printBinaryOperator ~inline Rhs:false operator;
3612
- rightPrinted;
3613
- ]
3611
+ if isAwait then
3612
+ Doc. concat
3613
+ [
3614
+ Doc. text " await " ;
3615
+ Doc. lparen;
3616
+ leftPrinted;
3617
+ printBinaryOperator ~inline Rhs:false operator;
3618
+ rightPrinted;
3619
+ Doc. rparen;
3620
+ ]
3621
+ else
3622
+ Doc. concat
3623
+ [
3624
+ leftPrinted;
3625
+ printBinaryOperator ~inline Rhs:false operator;
3626
+ rightPrinted;
3627
+ ]
3614
3628
in
3629
+
3615
3630
let doc =
3616
3631
if (not isLhs) && Parens. rhsBinaryExprOperand operator expr then
3617
3632
Doc. concat [Doc. lparen; doc; Doc. rparen]
Original file line number Diff line number Diff line change @@ -96,3 +96,6 @@ let f11 = (. ~x) => (. ~y) => 3
96
96
97
97
let f12 = @a (@b x ) => 3
98
98
let f13 = @a @b (~x ) => 3
99
+
100
+ let aw = (await (server -> start ))-> foo
101
+ let aw = (@foo (server -> start ))-> foo
Original file line number Diff line number Diff line change @@ -118,3 +118,6 @@ let f11 = (. ~x) => (. ~y) => 3
118
118
119
119
let f12 = @a x => 3
120
120
let f13 = (@a @b ~x) => 3
121
+
122
+ let aw = await (server->start)->foo
123
+ let aw = @foo (server->start)->foo
You can’t perform that action at this time.
0 commit comments