This repository was archived by the owner on Jun 15, 2023. It is now read-only.
File tree 6 files changed +24
-7
lines changed
parsing/grammar/expressions
6 files changed +24
-7
lines changed Original file line number Diff line number Diff line change 49
49
- Fix issue where printing nested pipe discards await https://github.com/rescript-lang/syntax/issues/687
50
50
- Fix issue where the JSX key type is not an optional string https://github.com/rescript-lang/syntax/pull/693
51
51
- Fix issue where the JSX fragment withouth children build error https://github.com/rescript-lang/syntax/pull/704
52
+ - Fix issue where async as an id cannot be used with application and labelled arguments https://github.com/rescript-lang/syntax/issues/707
53
+
52
54
53
55
#### :eyeglasses : Spec Compliance
54
56
Original file line number Diff line number Diff line change @@ -232,9 +232,13 @@ let rec goToClosing closingToken state =
232
232
(* Madness *)
233
233
let isEs6ArrowExpression ~inTernary p =
234
234
Parser. lookahead p (fun state ->
235
- (match state.Parser. token with
236
- | Lident "async" -> Parser. next state
237
- | _ -> () );
235
+ let async =
236
+ match state.Parser. token with
237
+ | Lident "async" ->
238
+ Parser. next state;
239
+ true
240
+ | _ -> false
241
+ in
238
242
match state.Parser. token with
239
243
| Lident _ | Underscore -> (
240
244
Parser. next state;
@@ -275,7 +279,7 @@ let isEs6ArrowExpression ~inTernary p =
275
279
| EqualGreater -> true
276
280
| _ -> false )
277
281
| Dot (* uncurried *) -> true
278
- | Tilde -> true
282
+ | Tilde when not async -> true
279
283
| Backtick ->
280
284
false
281
285
(* (` always indicates the start of an expr, can't be es6 parameter *)
Original file line number Diff line number Diff line change @@ -26,4 +26,7 @@ let async = {
26
26
result -> async -> mapAsync (a => doStuff (a ))
27
27
}
28
28
29
- let f = isPositive ? (async (a , b ) : int => a + b ) : async (c , d ) : int => c - d
29
+ let f = isPositive ? (async (a , b ) : int => a + b ) : async (c , d ) : int => c - d
30
+
31
+ let foo = async (~a = 34 )
32
+ let bar = async (~a )=> a + 1
Original file line number Diff line number Diff line change @@ -25,4 +25,6 @@ let f =
25
25
((if isPositive
26
26
then ((fun a -> fun b -> (a + b : int))[@res.async ])
27
27
else (((fun c -> fun d -> (c - d : int)))[@res.async ]))
28
- [@ns.ternary ])
28
+ [@ns.ternary ])
29
+ let foo = async ~a:((34)[@ns.namedArgLoc ])
30
+ let bar = ((fun ~a:((a)[@ns.namedArgLoc ]) -> a + 1)[@res.async ])
Original file line number Diff line number Diff line change @@ -98,4 +98,7 @@ let f12 = @a (@b x) => 3
98
98
let f13 = @a @b (~x ) => 3
99
99
100
100
let aw = (await (server -> start ))-> foo
101
- let aw = (@foo (server -> start ))-> foo
101
+ let aw = (@foo (server -> start ))-> foo
102
+
103
+ let foo = async (~a = 34 )
104
+ let bar = async (~a )=> a + 1
Original file line number Diff line number Diff line change @@ -121,3 +121,6 @@ let f13 = (@a @b ~x) => 3
121
121
122
122
let aw = await (server->start)->foo
123
123
let aw = @foo (server->start)->foo
124
+
125
+ let foo = async(~a=34)
126
+ let bar = async (~a) => a + 1
You can’t perform that action at this time.
0 commit comments