@@ -106,28 +106,28 @@ let file_to_module_name (f:string) : string =
106106 replace_chars s '_ ' "."
107107
108108let read_all_ast_files (files:list string) : dict =
109- let d = smap_create 100 in
109+ let d = SMap.create 100 in
110110 files |> List.iter (fun f ->
111111 let contents : (list string & list UEnv.binding & S.mlmodule) =
112112 match load_value_from_file f with
113113 | Some r -> r
114114 | None -> failwith (format1 "Could not load file %s" f) in
115- smap_add d (file_to_module_name f) contents);
115+ SMap.add d (file_to_module_name f) contents);
116116 d
117117
118- let build_decls_dict (d:dict) : smap S.mlmodule1 =
119- let dd = smap_create 100 in
120- smap_iter d (fun module_nm (_, _, decls) ->
118+ let build_decls_dict (d:dict) : SMap.t S.mlmodule1 =
119+ let dd = SMap.create 100 in
120+ SMap.iter d (fun module_nm (_, _, decls) ->
121121 List.iter (fun (decl:S.mlmodule1) ->
122122 List.iter (fun decl_nm ->
123- smap_add dd (module_nm ^ "." ^ decl_nm) decl
123+ SMap.add dd (module_nm ^ "." ^ decl_nm) decl
124124 ) (mlmodule1_name decl)
125125 ) decls
126126 );
127127 dd
128128
129129let rec collect_reachable_defs_aux
130- (dd:smap S.mlmodule1)
130+ (dd:SMap.t S.mlmodule1)
131131 (worklist:reachable_defs)
132132 (reachable_defs:reachable_defs) =
133133
@@ -138,7 +138,7 @@ let rec collect_reachable_defs_aux
138138 // print1 "Adding %s to reachable_defs\n" hd;
139139 let reachable_defs = add hd reachable_defs in
140140 let worklist =
141- let hd_decl = smap_try_find dd hd in
141+ let hd_decl = SMap.try_find dd hd in
142142 match hd_decl with
143143 | None -> worklist
144144 | Some hd_decl ->
@@ -153,7 +153,7 @@ let rec collect_reachable_defs_aux
153153
154154let collect_reachable_defs (d:dict) (root_module:string) : reachable_defs =
155155 let dd = build_decls_dict d in
156- let root_decls = smap_try_find d root_module |> must |> (fun (_, _, decls) -> decls) in
156+ let root_decls = SMap.try_find d root_module |> must |> (fun (_, _, decls) -> decls) in
157157 let worklist = List.fold_left (fun worklist decl ->
158158 addn
159159 (decl |> mlmodule1_name |> List.map (fun s -> root_module ^ "." ^ s))
@@ -186,7 +186,7 @@ let extract (files:list string) (odir:string) (libs:string) : unit =
186186 let g = empty_env external_libs d all_modules reachable_defs in
187187 let _, all_rust_files = List.fold_left (fun (g, all_rust_files) f ->
188188 // print1 "Extracting file: %s\n" f;
189- let (_, bs, ds) = smap_try_find d f |> must in
189+ let (_, bs, ds) = SMap.try_find d f |> must in
190190 let s, g = extract_one g f bs ds in
191191 let rust_fname = concat_dir_filename odir (rust_file_name f) in
192192 let rust_f = open_file_for_writing rust_fname in
0 commit comments