@@ -2286,7 +2286,6 @@ and parse_template_expr ?prefix p =
22862286 Some prefix
22872287 | _ -> Some " js"
22882288 in
2289- let start_pos = p.Parser. start_pos in
22902289
22912290 let parse_parts p =
22922291 let rec aux acc =
@@ -2319,13 +2318,9 @@ and parse_template_expr ?prefix p =
23192318 let parts = parse_parts p in
23202319 let strings = List. map fst parts in
23212320 let values = Ext_list. filter_map parts snd in
2322- let end_pos = p.Parser. end_pos in
23232321
2324- let gen_tagged_template_call lident =
2325- let ident =
2326- Ast_helper.Exp. ident ~attrs: [] ~loc: Location. none
2327- (Location. mknoloc lident)
2328- in
2322+ let gen_tagged_template_call (lident_loc : Longident.t Location.loc ) =
2323+ let ident = Ast_helper.Exp. ident ~attrs: [] ~loc: lident_loc.loc lident_loc in
23292324 let strings_array =
23302325 Ast_helper.Exp. array ~attrs: [] ~loc: Location. none strings
23312326 in
@@ -2334,7 +2329,7 @@ and parse_template_expr ?prefix p =
23342329 in
23352330 Ast_helper.Exp. apply
23362331 ~attrs: [tagged_template_literal_attr]
2337- ~loc: (mk_loc start_pos end_pos) ident
2332+ ~loc: lident_loc.loc ident
23382333 [(Nolabel , strings_array); (Nolabel , values_array)]
23392334 in
23402335
@@ -2374,7 +2369,7 @@ and parse_template_expr ?prefix p =
23742369 match prefix with
23752370 | Some {txt = Longident. Lident ("js" | "j" | "json" ); _} | None ->
23762371 gen_interpolated_string ()
2377- | Some { txt = lident } -> gen_tagged_template_call lident
2372+ | Some lident_loc -> gen_tagged_template_call lident_loc
23782373
23792374(* Overparse: let f = a : int => a + 1, is it (a : int) => or (a): int =>
23802375 * Also overparse constraints:
0 commit comments