This repository was archived by the owner on Jun 15, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +24
-7
lines changed
parsing/grammar/expressions Expand file tree Collapse file tree 6 files changed +24
-7
lines changed Original file line number Diff line number Diff line change 4949- Fix issue where printing nested pipe discards await https://github.com/rescript-lang/syntax/issues/687
5050- Fix issue where the JSX key type is not an optional string https://github.com/rescript-lang/syntax/pull/693
5151- 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+
5254
5355#### :eyeglasses : Spec Compliance
5456
Original file line number Diff line number Diff line change @@ -232,9 +232,13 @@ let rec goToClosing closingToken state =
232232(* Madness *)
233233let isEs6ArrowExpression ~inTernary p =
234234 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
238242 match state.Parser. token with
239243 | Lident _ | Underscore -> (
240244 Parser. next state;
@@ -275,7 +279,7 @@ let isEs6ArrowExpression ~inTernary p =
275279 | EqualGreater -> true
276280 | _ -> false )
277281 | Dot (* uncurried *) -> true
278- | Tilde -> true
282+ | Tilde when not async -> true
279283 | Backtick ->
280284 false
281285 (* (` 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 = {
2626 result -> async -> mapAsync (a => doStuff (a ))
2727}
2828
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 =
2525 ((if isPositive
2626 then ((fun a -> fun b -> (a + b : int))[@res.async ])
2727 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
9898let f13 = @a @b (~x ) => 3
9999
100100let 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
121121
122122let aw = await (server->start)->foo
123123let 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