diff --git a/src/loader/cmi.ml b/src/loader/cmi.ml index a852c7c2fb..f043a72cbc 100644 --- a/src/loader/cmi.ml +++ b/src/loader/cmi.ml @@ -27,6 +27,10 @@ module Paths = Odoc_model.Paths module Compat = struct #if OCAML_VERSION >= (4, 14, 0) +#if OCAML_VERSION >= (5, 3, 0) + let newty2 = Btype.newty2 +#endif + (** this is the type on which physical equality is meaningful *) type repr_type_node = Types.transient_expr diff --git a/src/loader/doc_attr.ml b/src/loader/doc_attr.ml index 1f3273533e..287318f0c1 100644 --- a/src/loader/doc_attr.ml +++ b/src/loader/doc_attr.ml @@ -39,8 +39,10 @@ let load_constant_string = function Pexp_constant (Const_string (text, _)) #elif OCAML_VERSION < (4,11,0) Pexp_constant (Pconst_string (text, _)) -#else +#elif OCAML_VERSION < (5,3,0) Pexp_constant (Pconst_string (text, _, _)) +#else + Pexp_constant {pconst_desc= Pconst_string (text, _, _); _} #endif ; pexp_loc = loc; _} -> Some (text , loc) diff --git a/src/syntax_highlighter/syntax_highlighter.ml b/src/syntax_highlighter/syntax_highlighter.ml index e6199372b2..688b85cc62 100644 --- a/src/syntax_highlighter/syntax_highlighter.ml +++ b/src/syntax_highlighter/syntax_highlighter.ml @@ -145,6 +145,12 @@ let tag_of_token (tok : Parser.token) = | ANDOP _ -> "ANDOP" | LETOP _ -> "LETOP" #endif +#if OCAML_VERSION >= (5,3,0) + | METAOCAML_ESCAPE -> "METAOCAML_ESCAPE" + | METAOCAML_BRACKET_OPEN -> "METAOCAML_BRACKET_OPEN" + | METAOCAML_BRACKET_CLOSE -> "METAOCAML_BRACKET_CLOSE" + | EFFECT -> "EFFECT" +#endif let syntax_highlighting_locs src = let lexbuf = Lexing.from_string diff --git a/src/xref2/shape_tools.cppo.ml b/src/xref2/shape_tools.cppo.ml index 74b8519a08..9dc63087d8 100644 --- a/src/xref2/shape_tools.cppo.ml +++ b/src/xref2/shape_tools.cppo.ml @@ -115,7 +115,7 @@ module MkId = Identifier.Mk let unit_of_uid uid = match uid with | Shape.Uid.Compilation_unit s -> Some s - | Item { comp_unit; id = _ } -> Some comp_unit + | Item { comp_unit; _ } -> Some comp_unit | Predef _ -> None | Internal -> None diff --git a/test/xref2/lib/common.cppo.ml b/test/xref2/lib/common.cppo.ml index 474d75cfd9..a427375894 100644 --- a/test/xref2/lib/common.cppo.ml +++ b/test/xref2/lib/common.cppo.ml @@ -35,8 +35,10 @@ let cmt_of_string s = let p = Parse.implementation l in #if OCAML_VERSION < (5,2,0) Typemod.type_implementation "" "" "" env p -#else +#elif OCAML_VERSION < (5,3,0) Typemod.type_implementation (Unit_info.make ~source_file:"" "") env p +#else + Typemod.type_implementation Unit_info.(make ~source_file:"" Impl "") env p #endif let parent = Odoc_model.Paths.Identifier.Mk.page (None, PageName.make_std "None") diff --git a/test/xref2/module_preamble.t/run.t b/test/xref2/module_preamble.t/run.t index 3bc925f218..3c86e18e03 100644 --- a/test/xref2/module_preamble.t/run.t +++ b/test/xref2/module_preamble.t/run.t @@ -9,7 +9,7 @@ and that "hidden" modules (eg. `A__b`, rendered to `html/A__b`) are not rendered $ ocamlc -bin-annot -o a__b.cmo -c b.ml $ ocamlc -bin-annot -o a.cmi -c a.mli $ ocamlc -bin-annot -o a.cmo -c a.ml - $ ocamlc -bin-annot -a -o a.cma a.cmo a__b.cmo + $ ocamlc -bin-annot -a -o a.cma a__b.cmo a.cmo $ odoc compile --pkg test -o a__b.odoc -I . a__b.cmti $ odoc compile --pkg test -o a.odoc -I . a.cmti diff --git a/test/xref2/module_type_of_extra.t/run.t b/test/xref2/module_type_of_extra.t/run.t index 5a3c1e0f5c..ef773b7be6 100644 --- a/test/xref2/module_type_of_extra.t/run.t +++ b/test/xref2/module_type_of_extra.t/run.t @@ -37,28 +37,10 @@ More advanced uses of `module type of`, including using functors. $ ocamlc -c -bin-annot a.mli $ ocamlc -c -bin-annot b.mli - $ ocamlc -i b.mli - module X : sig type t end - module type X1 = sig type t end - module type X2 = sig module X : sig type t end end - module type X3 = sig type t end - module Y : functor (A : sig type t end) -> sig type t end - module type Foo = - sig - module X : sig type t end - module Y : functor (A : sig type t end) -> sig module Z = X end - module type Z = functor (A : sig type t end) -> sig module Z = X end - module X' : sig type t = X.t end - end - module type X4 = functor (A : sig type t end) -> sig type t end - module SubX : sig type t type u end - module type X5 = - sig - module Y : functor (A : sig type t end) -> sig module Z = SubX end - module type Z = functor (A : sig type t end) -> sig module Z = SubX end - module X' : sig type t = SubX.t end - end - module type X6 = sig type t end + +Omitted for stability: +$ ocamlc -i b.mli + $ odoc compile a.cmti $ odoc compile -I . b.cmti $ odoc link -I . a.odoc