@@ -48,11 +48,11 @@ let locate_sig ~loc lid =
48
48
List. fold_left (fun sig_items path_item ->
49
49
let rec loop sig_items =
50
50
match sig_items with
51
- | Sig_module ({ name } , { md_type = Mty_signature sig_items }, _) :: _
52
- when name = path_item ->
51
+ | Sig_module (id , { md_type = Mty_signature sig_items }, _) :: _
52
+ when Ident. name id = path_item ->
53
53
sig_items
54
- | Sig_modtype ({ name } , { mtd_type = Some (Mty_signature sig_items) }) :: _
55
- when name = path_item ->
54
+ | Sig_modtype (id , { mtd_type = Some (Mty_signature sig_items) }) :: _
55
+ when Ident. name id = path_item ->
56
56
sig_items
57
57
| _ :: sig_items ->
58
58
loop sig_items
@@ -77,18 +77,18 @@ let locate_tsig_item f ~loc sig_items lid =
77
77
let locate_ttype_decl =
78
78
locate_tsig_item (fun elem ->
79
79
function
80
- | Sig_type ({ name } , type_decl , _ ) when name = elem -> Some type_decl
80
+ | Sig_type (id , type_decl , _ ) when Ident. name id = elem -> Some type_decl
81
81
| _ -> None )
82
82
83
83
let locate_tmodtype_decl =
84
84
locate_tsig_item (fun elem ->
85
85
function
86
- | Sig_modtype ({ name } , type_decl ) when name = elem -> Some type_decl
86
+ | Sig_modtype (id , type_decl ) when Ident. name id = elem -> Some type_decl
87
87
| _ -> None )
88
88
89
89
let rec longident_of_path path =
90
90
match path with
91
- | Path. Pident { name } -> Lident name
91
+ | Path. Pident id -> Lident ( Ident. name id)
92
92
| Path. Pdot (path , name , _ ) -> Ldot (longident_of_path path, name)
93
93
| Path. Papply (lhs , rhs ) -> Lapply (longident_of_path lhs, longident_of_path rhs)
94
94
@@ -162,7 +162,7 @@ let ptype_decl_of_ttype_decl ~manifest ~subst ptype_name ttype_decl =
162
162
and ptype_kind =
163
163
let map_labels =
164
164
List. map (fun ld ->
165
- { pld_name = { txt = ld.ld_id.name ; loc = ld.ld_loc };
165
+ { pld_name = { txt = Ident. name ld.ld_id; loc = ld.ld_loc };
166
166
pld_mutable = ld.ld_mutable;
167
167
pld_type = core_type_of_type_expr ~subst ld.ld_type;
168
168
pld_loc = ld.ld_loc;
@@ -184,7 +184,7 @@ let ptype_decl_of_ttype_decl ~manifest ~subst ptype_name ttype_decl =
184
184
#endif
185
185
in
186
186
Ptype_variant (constrs |> List. map (fun cd ->
187
- { pcd_name = { txt = cd.cd_id.name ; loc = cd.cd_loc };
187
+ { pcd_name = { txt = Ident. name cd.cd_id; loc = cd.cd_loc };
188
188
pcd_args = map_args cd.cd_args;
189
189
pcd_res = (match cd.cd_res with Some x -> Some (core_type_of_type_expr ~subst x)
190
190
| None -> None );
@@ -275,8 +275,8 @@ let rec psig_of_tsig ~subst ?(trec=[]) tsig =
275
275
let psig_desc = Psig_type (Recursive , trec) in
276
276
#endif
277
277
{ psig_desc; psig_loc = Location. none } :: psig_of_tsig ~subst tsig
278
- | Sig_type ({ name } , ttype_decl , rec_flag ) :: rest ->
279
- let ptype_decl = ptype_decl_of_ttype_decl ~manifest: None ~subst (Location. mknoloc name) ttype_decl in
278
+ | Sig_type (id , ttype_decl , rec_flag ) :: rest ->
279
+ let ptype_decl = ptype_decl_of_ttype_decl ~manifest: None ~subst (Location. mknoloc ( Ident. name id) ) ttype_decl in
280
280
begin match rec_flag with
281
281
| Trec_not ->
282
282
#if OCAML_VERSION < (4 , 03 , 0 )
@@ -288,7 +288,7 @@ let rec psig_of_tsig ~subst ?(trec=[]) tsig =
288
288
| Trec_first | Trec_next ->
289
289
psig_of_tsig ~subst ~trec: (ptype_decl :: trec) rest
290
290
end
291
- | Sig_value ({ name } , { val_type; val_kind; val_loc; val_attributes } ) :: rest ->
291
+ | Sig_value (id , { val_type; val_kind; val_loc; val_attributes } ) :: rest ->
292
292
let pval_prim =
293
293
match val_kind with
294
294
| Val_reg -> []
@@ -304,7 +304,7 @@ let rec psig_of_tsig ~subst ?(trec=[]) tsig =
304
304
| _ -> assert false
305
305
in
306
306
{ psig_desc = Psig_value {
307
- pval_name = Location. mknoloc name; pval_loc = val_loc;
307
+ pval_name = Location. mknoloc ( Ident. name id) ; pval_loc = val_loc;
308
308
pval_attributes = val_attributes;
309
309
pval_prim; pval_type = core_type_of_type_expr ~subst val_type; };
310
310
psig_loc = val_loc } ::
0 commit comments