Skip to content

Commit bdbc51e

Browse files
bloodyowlcknitt
authored andcommitted
Map locations correctly
1 parent 861fbcf commit bdbc51e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

jscomp/syntax/src/res_core.ml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3927,14 +3927,14 @@ and parse_dict_expr ~start_pos p =
39273927
~f:parse_dict_expr_row p
39283928
in
39293929
let loc = mk_loc start_pos p.prev_end_pos in
3930-
let to_key_value_pair record_item =
3930+
let to_key_value_pair
3931+
(record_item : Longident.t Location.loc * Parsetree.expression) =
39313932
match record_item with
3932-
| {Location.txt = Longident.Lident key}, value_expr ->
3933+
| {Location.txt = Longident.Lident key; loc}, valueExpr ->
39333934
Some
3934-
(Ast_helper.Exp.tuple ~loc
3935-
[
3936-
Ast_helper.Exp.constant ~loc (Pconst_string (key, None)); value_expr;
3937-
])
3935+
(Ast_helper.Exp.tuple
3936+
~loc:(mk_loc loc.loc_start valueExpr.pexp_loc.loc_end)
3937+
[Ast_helper.Exp.constant ~loc (Pconst_string (key, None)); valueExpr])
39383938
| _ -> None
39393939
in
39403940
let key_value_pairs = List.filter_map to_key_value_pair exprs in

0 commit comments

Comments
 (0)