From 593b898f0658569213b09da0db5d6547fc815ec9 Mon Sep 17 00:00:00 2001 From: Paul-Elliot Date: Fri, 13 Dec 2024 12:32:04 +0100 Subject: [PATCH] Label boolean argument for loading functions --- src/loader/cmi.ml | 2 +- src/loader/cmi.mli | 2 +- src/loader/cmt.ml | 2 +- src/loader/cmt.mli | 2 +- src/loader/cmti.ml | 2 +- src/loader/cmti.mli | 2 +- src/loader/odoc_loader.ml | 6 +++--- test/xref2/lib/common.cppo.ml | 4 ++-- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/loader/cmi.ml b/src/loader/cmi.ml index 2e2fc58205..d627d95ecf 100644 --- a/src/loader/cmi.ml +++ b/src/loader/cmi.ml @@ -1171,7 +1171,7 @@ and read_signature env parent (items : Odoc_model.Compat.signature) = fst @@ read_signature_noenv env parent items -let read_interface root name suppress_warnings intf = +let read_interface root name ~suppress_warnings intf = let id = Identifier.Mk.root (root, Odoc_model.Names.ModuleName.make_std name) in diff --git a/src/loader/cmi.mli b/src/loader/cmi.mli index 4539070e27..831a7cf941 100644 --- a/src/loader/cmi.mli +++ b/src/loader/cmi.mli @@ -27,7 +27,7 @@ type env = { val read_interface : Odoc_model.Paths.Identifier.ContainerPage.t option -> string -> - bool -> + suppress_warnings:bool -> Odoc_model.Compat.signature -> Paths.Identifier.RootModule.t * Odoc_model.Lang.Signature.t diff --git a/src/loader/cmt.ml b/src/loader/cmt.ml index b0aa51ee0b..943dff835b 100644 --- a/src/loader/cmt.ml +++ b/src/loader/cmt.ml @@ -616,7 +616,7 @@ and read_structure : | _ -> ({ Signature.items = Comment (`Docs doc_post) :: items; compiled=false; removed = []; doc }, tags) -let read_implementation root name suppress_warnings impl = +let read_implementation root name ~suppress_warnings impl = let id = Identifier.Mk.root (root, Odoc_model.Names.ModuleName.make_std name) in diff --git a/src/loader/cmt.mli b/src/loader/cmt.mli index 297bb368b8..37f77087bf 100644 --- a/src/loader/cmt.mli +++ b/src/loader/cmt.mli @@ -17,7 +17,7 @@ val read_implementation : Odoc_model.Paths.Identifier.ContainerPage.t option -> string -> - bool -> + suppress_warnings:bool -> Typedtree.structure -> Odoc_model.Paths.Identifier.RootModule.t * Odoc_model.Lang.Signature.t diff --git a/src/loader/cmti.ml b/src/loader/cmti.ml index 438964375b..52ddad1faf 100644 --- a/src/loader/cmti.ml +++ b/src/loader/cmti.ml @@ -815,7 +815,7 @@ and read_signature : | _ -> ({ Signature.items = Comment (`Docs doc_post) :: items; compiled=false; removed = []; doc }, tags) -let read_interface root name suppress_warnings intf = +let read_interface root name ~suppress_warnings intf = let id = Identifier.Mk.root (root, Odoc_model.Names.ModuleName.make_std name) in diff --git a/src/loader/cmti.mli b/src/loader/cmti.mli index 9f3c82002f..d92d2c52af 100644 --- a/src/loader/cmti.mli +++ b/src/loader/cmti.mli @@ -27,7 +27,7 @@ val read_module_expr : val read_interface : Odoc_model.Paths.Identifier.ContainerPage.t option -> string -> - bool -> + suppress_warnings:bool -> Typedtree.signature -> Paths.Identifier.RootModule.t * Odoc_model.Lang.Signature.t diff --git a/src/loader/odoc_loader.ml b/src/loader/odoc_loader.ml index cea4ebd45e..21eb6a7215 100644 --- a/src/loader/odoc_loader.ml +++ b/src/loader/odoc_loader.ml @@ -119,7 +119,7 @@ let read_cmti ~make_root ~parent ~filename ~suppress_warnings () = cmt_info.cmt_builddir ) in let id, sg, canonical = - Cmti.read_interface parent name suppress_warnings intf + Cmti.read_interface parent name ~suppress_warnings intf in compilation_unit_of_sig ~make_root ~imports:cmt_info.cmt_imports ~interface ~sourcefile ~name ~id ?canonical sg) @@ -178,7 +178,7 @@ let read_cmt ~make_root ~parent ~filename ~suppress_warnings () = ~id content | Implementation impl -> let id, sg, canonical = - Cmt.read_implementation parent name suppress_warnings impl + Cmt.read_implementation parent name ~suppress_warnings impl in compilation_unit_of_sig ~make_root ~imports ~interface ~sourcefile ~name ~id ?canonical sg @@ -189,7 +189,7 @@ let read_cmi ~make_root ~parent ~filename ~suppress_warnings () = match cmi_info.cmi_crcs with | (name, (Some _ as interface)) :: imports when name = cmi_info.cmi_name -> let id, sg = - Cmi.read_interface parent name suppress_warnings + Cmi.read_interface parent name ~suppress_warnings (Odoc_model.Compat.signature cmi_info.cmi_sign) in compilation_unit_of_sig ~make_root ~imports ~interface ~name ~id sg diff --git a/test/xref2/lib/common.cppo.ml b/test/xref2/lib/common.cppo.ml index 9f4237c9d7..cd5ee28990 100644 --- a/test/xref2/lib/common.cppo.ml +++ b/test/xref2/lib/common.cppo.ml @@ -70,7 +70,7 @@ let root_pp fmt (_ : Odoc_model.Root.t) = Format.fprintf fmt "Common.root" let model_of_string str = let cmti = cmti_of_string str in - Odoc_loader__Cmti.read_interface (Some parent) "Root" false cmti + Odoc_loader__Cmti.read_interface (Some parent) "Root" ~suppress_warnings:false cmti let model_of_string_impl str = #if OCAML_VERSION < (4,13,0) @@ -78,7 +78,7 @@ let model_of_string_impl str = #else let cmt = (cmt_of_string str).structure in #endif - Odoc_loader__Cmt.read_implementation (Some parent) "Root" false cmt + Odoc_loader__Cmt.read_implementation (Some parent) "Root" ~suppress_warnings:false cmt let signature_of_mli_string str = Odoc_xref2.Ident.reset ();