@@ -86968,10 +86968,16 @@ module Js_cmj_load : sig
8696886968 it depends on {!Js_cmj_datasets}, for non-browser environment, it fails
8696986969 *)
8697086970
86971-
86971+ type path = string
86972+ type cmj_load_info = {
86973+ cmj_table : Js_cmj_format.t ;
86974+ cmj_path : path ;
86975+ }
8697286976
8697386977(** return path and meta data *)
86974- val find_cmj_exn : string -> string * Js_cmj_format.t
86978+ val find_cmj_exn :
86979+ string ->
86980+ cmj_load_info
8697586981
8697686982end = struct
8697786983#1 "js_cmj_load.ml"
@@ -87005,9 +87011,14 @@ end = struct
8700587011*)
8700687012
8700787013
87014+ type path = string
87015+ type cmj_load_info = {
87016+ cmj_table : Js_cmj_format.t ;
87017+ cmj_path : path ;
87018+ }
8700887019
8700987020
87010- let find_cmj_exn file : string * Js_cmj_format.t =
87021+ let find_cmj_exn file : cmj_load_info =
8701187022 let target = Ext_string.uncapitalize_ascii (Filename.basename file) in
8701287023 match String_map.find_exn !Js_cmj_datasets.data_sets target with
8701387024 | v
@@ -87018,7 +87029,7 @@ let find_cmj_exn file : string * Js_cmj_format.t =
8701887029 Ext_log.warn __LOC__
8701987030 "@[%s corrupted in database, when looking %s while compiling %s please update @]" file target !Location.input_name ;
8702087031 Bs_exception.error (Cmj_not_found file)
87021- | v -> "BROWSER", v
87032+ | v -> {cmj_path = "BROWSER"; cmj_table = v}
8702287033 (* see {!Js_packages_info.string_of_module_id} *)
8702387034 end
8702487035 | exception Not_found
@@ -96336,23 +96347,10 @@ module Lam_compile_env : sig
9633696347
9633796348
9633896349
96339-
96340-
96341-
96342-
96343-
9634496350(** Helper for global Ocaml module index into meaningful names *)
9634596351
9634696352
9634796353
96348- type path = string
96349-
96350-
96351-
96352-
96353- type _ t =
96354- | No_env : bool t
96355- | Has_env : Env.t -> bool t
9635696354
9635796355
9635896356type ident_info = {
@@ -96464,16 +96462,10 @@ end = struct
9646496462module E = Js_exp_make
9646596463module S = Js_stmt_make
9646696464
96467- type path = string
96468-
96469- type ml_module_info = {
96470- cmj_table : Js_cmj_format.t ;
96471- cmj_path : path;
96472- }
9647396465
9647496466type env_value =
96475- | Ml of ml_module_info
96476- | Runtime of ml_module_info
96467+ | Ml of Js_cmj_load.cmj_load_info
96468+ | Runtime of Js_cmj_load.cmj_load_info
9647796469 (**
9647896470 [Runtime (pure, path, cmj_format)]
9647996471 A built in module probably from our runtime primitives,
@@ -96556,10 +96548,10 @@ let query_external_id_info (module_id : Ident.t) (name : string) : ident_info =
9655696548 let cmj_table =
9655796549 match Lam_module_ident.Hash.find_opt cached_tbl oid with
9655896550 | None ->
96559- let cmj_path, cmj_table =
96551+ let cmj_load_info =
9656096552 Js_cmj_load.find_cmj_exn (module_id.name ^ Literals.suffix_cmj) in
96561- oid +> Ml { cmj_table ; cmj_path } ;
96562- cmj_table
96553+ oid +> Ml cmj_load_info ;
96554+ cmj_load_info. cmj_table
9656396555 | Some (Ml { cmj_table } )
9656496556 -> cmj_table
9656596557 | Some (Runtime _) -> assert false
@@ -96577,12 +96569,6 @@ let query_external_id_info (module_id : Ident.t) (name : string) : ident_info =
9657796569
9657896570
9657996571
96580- (* TODO: it does not make sense to cache
96581- [Runtime]
96582- and [externals]*)
96583- type _ t =
96584- | No_env : bool t
96585- | Has_env : Env.t -> bool t (* Indicate it is pure or not *)
9658696572
9658796573
9658896574
@@ -96610,10 +96596,10 @@ let get_package_path_from_cmj
9661096596 | Runtime
9661196597 | External _ -> assert false
9661296598 | Ml ->
96613- let (cmj_path, cmj_table) =
96599+ let ({Js_cmj_load. cmj_table} as cmj_load_info ) =
9661496600 Js_cmj_load.find_cmj_exn (Lam_module_ident.name id ^ Literals.suffix_cmj) in
96615- id +> Ml {cmj_table;cmj_path } ;
96616- (cmj_path,
96601+ id +> Ml cmj_load_info ;
96602+ (cmj_load_info. cmj_path,
9661796603 Js_cmj_format.get_npm_package_path cmj_table,
9661896604 Js_cmj_format.get_cmj_case cmj_table )
9661996605 end
@@ -96630,10 +96616,13 @@ let is_pure_module (oid : Lam_module_ident.t) =
9663096616 | Ml ->
9663196617 begin match Lam_module_ident.Hash.find_opt cached_tbl oid with
9663296618 | None ->
96633- let (cmj_path, cmj_table) =
96634- Js_cmj_load.find_cmj_exn (Lam_module_ident.name oid ^ Literals.suffix_cmj) in
96635- oid +> Ml {cmj_table;cmj_path } ;
96636- Js_cmj_format.is_pure cmj_table
96619+ begin
96620+ match Js_cmj_load.find_cmj_exn (Lam_module_ident.name oid ^ Literals.suffix_cmj) with
96621+ | cmj_load_info ->
96622+ oid +> Ml cmj_load_info ;
96623+ Js_cmj_format.is_pure cmj_load_info.cmj_table
96624+ | exception _ -> false
96625+ end
9663796626 | Some (Ml{cmj_table}|Runtime {cmj_table}) ->
9663896627 Js_cmj_format.is_pure cmj_table
9663996628 | Some External -> false
0 commit comments