Skip to content

Commit 60e2541

Browse files
committed
sync syntax
1 parent 19760da commit 60e2541

File tree

5 files changed

+11
-5
lines changed

5 files changed

+11
-5
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
- Fix location issue in error messages with JSX V4 where the multiple props types are defined https://github.com/rescript-lang/syntax/pull/655
2222
- Fix location issue in make function in JSX V4 that breaks dead code elimination https://github.com/rescript-lang/syntax/pull/660
23+
- Fix parsing (hence pretty printing) of expressions with underscore `_` and comments.
2324

2425
# 10.1.0-alpha.2
2526

jscomp/napkin/CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
- Fix printing of comments inside empty blocks https://github.com/rescript-lang/syntax/pull/647
3131
- Fix location issue in error messages with JSX V4 where the multiple props types are defined https://github.com/rescript-lang/syntax/pull/655
3232
- Fix location issue in make function in JSX V4 that breaks dead code elimination https://github.com/rescript-lang/syntax/pull/660
33+
- Fix parsing (hence pretty printing) of expressions with underscore `_` and comments.
3334

3435
## ReScript 10.0
3536

lib/4.06.1/unstable/js_playground_compiler.ml

+4-2
Original file line numberDiff line numberDiff line change
@@ -283382,11 +283382,13 @@ let processUnderscoreApplication args =
283382283382
| _ -> arg
283383283383
in
283384283384
let args = List.map check_arg args in
283385-
let wrap exp_apply =
283385+
let wrap (exp_apply : Parsetree.expression) =
283386283386
match !exp_question with
283387283387
| Some {pexp_loc = loc} ->
283388283388
let pattern =
283389-
Ast_helper.Pat.mk (Ppat_var (Location.mkloc hidden_var loc)) ~loc
283389+
Ast_helper.Pat.mk
283390+
(Ppat_var (Location.mkloc hidden_var loc))
283391+
~loc:Location.none
283390283392
in
283391283393
Ast_helper.Exp.mk (Pexp_fun (Nolabel, None, pattern, exp_apply)) ~loc
283392283394
| None -> exp_apply

lib/4.06.1/whole_compiler.ml

+4-2
Original file line numberDiff line numberDiff line change
@@ -296906,11 +296906,13 @@ let processUnderscoreApplication args =
296906296906
| _ -> arg
296907296907
in
296908296908
let args = List.map check_arg args in
296909-
let wrap exp_apply =
296909+
let wrap (exp_apply : Parsetree.expression) =
296910296910
match !exp_question with
296911296911
| Some {pexp_loc = loc} ->
296912296912
let pattern =
296913-
Ast_helper.Pat.mk (Ppat_var (Location.mkloc hidden_var loc)) ~loc
296913+
Ast_helper.Pat.mk
296914+
(Ppat_var (Location.mkloc hidden_var loc))
296915+
~loc:Location.none
296914296916
in
296915296917
Ast_helper.Exp.mk (Pexp_fun (Nolabel, None, pattern, exp_apply)) ~loc
296916296918
| None -> exp_apply

0 commit comments

Comments
 (0)