Skip to content

Commit 9b35205

Browse files
committed
Map locations correctly
1 parent 394ca93 commit 9b35205

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

jscomp/syntax/src/res_core.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3947,11 +3947,11 @@ and parseDictExpr ~startPos p =
39473947
~f:parseDictExprRow p
39483948
in
39493949
let loc = mkLoc startPos p.prevEndPos in
3950-
let toKeyValuePair recordItem =
3950+
let toKeyValuePair (recordItem: (Longident.t Location.loc * Parsetree.expression)) =
39513951
match recordItem with
3952-
| {Location.txt = Longident.Lident key}, valueExpr ->
3952+
| {Location.txt = Longident.Lident key; loc}, valueExpr ->
39533953
Some
3954-
(Ast_helper.Exp.tuple ~loc
3954+
(Ast_helper.Exp.tuple ~loc:(mkLoc loc.loc_start valueExpr.pexp_loc.loc_end)
39553955
[Ast_helper.Exp.constant ~loc (Pconst_string (key, None)); valueExpr])
39563956
| _ -> None
39573957
in

0 commit comments

Comments
 (0)