Skip to content

Commit 5b4dfc3

Browse files
Julowjonludlam
authored andcommitted
Compat with OCaml 5.3.0~alpha1
1 parent 8fcbb6a commit 5b4dfc3

File tree

6 files changed

+18
-4
lines changed

6 files changed

+18
-4
lines changed

src/loader/cmi.ml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ module Paths = Odoc_model.Paths
2727

2828
module Compat = struct
2929
#if OCAML_VERSION >= (4, 14, 0)
30+
#if OCAML_VERSION >= (5, 3, 0)
31+
let newty2 = Btype.newty2
32+
#endif
33+
3034
(** this is the type on which physical equality is meaningful *)
3135
type repr_type_node = Types.transient_expr
3236

src/loader/doc_attr.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,10 @@ let load_constant_string = function
3939
Pexp_constant (Const_string (text, _))
4040
#elif OCAML_VERSION < (4,11,0)
4141
Pexp_constant (Pconst_string (text, _))
42-
#else
42+
#elif OCAML_VERSION < (5,3,0)
4343
Pexp_constant (Pconst_string (text, _, _))
44+
#else
45+
Pexp_constant {pconst_desc= Pconst_string (text, _, _); _}
4446
#endif
4547
; pexp_loc = loc; _} ->
4648
Some (text , loc)

src/syntax_highlighter/syntax_highlighter.ml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,12 @@ let tag_of_token (tok : Parser.token) =
145145
| ANDOP _ -> "ANDOP"
146146
| LETOP _ -> "LETOP"
147147
#endif
148+
#if OCAML_VERSION >= (5,3,0)
149+
| METAOCAML_ESCAPE -> "METAOCAML_ESCAPE"
150+
| METAOCAML_BRACKET_OPEN -> "METAOCAML_BRACKET_OPEN"
151+
| METAOCAML_BRACKET_CLOSE -> "METAOCAML_BRACKET_CLOSE"
152+
| EFFECT -> "EFFECT"
153+
#endif
148154

149155
let syntax_highlighting_locs src =
150156
let lexbuf = Lexing.from_string

src/xref2/shape_tools.cppo.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ module MkId = Identifier.Mk
5858
let unit_of_uid uid =
5959
match uid with
6060
| Shape.Uid.Compilation_unit s -> Some s
61-
| Item { comp_unit; id = _ } -> Some comp_unit
61+
| Item { comp_unit; _ } -> Some comp_unit
6262
| Predef _ -> None
6363
| Internal -> None
6464

test/xref2/lib/common.cppo.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ let cmt_of_string s =
3434
let p = Parse.implementation l in
3535
#if OCAML_VERSION < (5,2,0)
3636
Typemod.type_implementation "" "" "" env p
37-
#else
37+
#elif OCAML_VERSION < (5,3,0)
3838
Typemod.type_implementation (Unit_info.make ~source_file:"" "") env p
39+
#else
40+
Typemod.type_implementation Unit_info.(make ~source_file:"" Impl "") env p
3941
#endif
4042

4143
let parent = Odoc_model.Paths.Identifier.Mk.page (None, Odoc_model.Names.PageName.make_std "None")

test/xref2/module_preamble.t/run.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ and that "hidden" modules (eg. `A__b`, rendered to `html/A__b`) are not rendered
99
$ ocamlc -bin-annot -o a__b.cmo -c b.ml
1010
$ ocamlc -bin-annot -o a.cmi -c a.mli
1111
$ ocamlc -bin-annot -o a.cmo -c a.ml
12-
$ ocamlc -bin-annot -a -o a.cma a.cmo a__b.cmo
12+
$ ocamlc -bin-annot -a -o a.cma a__b.cmo a.cmo
1313

1414
$ odoc compile --pkg test -o a__b.odoc -I . a__b.cmti
1515
$ odoc compile --pkg test -o a.odoc -I . a.cmti

0 commit comments

Comments
 (0)