From f21947d0c6e970b7a4df240c5581b639169352b2 Mon Sep 17 00:00:00 2001 From: "Mohammad-Habib.Javaid" Date: Wed, 17 Jul 2024 16:44:23 +0200 Subject: [PATCH 1/4] fix error with Tsubst in ocaml 4.13 (the type definition has been changed) --- src/odoc_wiki/odoc_import.ml | 4 ++-- wikidoc.opam | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/odoc_wiki/odoc_import.ml b/src/odoc_wiki/odoc_import.ml index 7d9b736..1614ffe 100644 --- a/src/odoc_wiki/odoc_import.ml +++ b/src/odoc_wiki/odoc_import.ml @@ -32,7 +32,7 @@ let raw_string_of_type_list ?(margin = default_margin) sep type_list = let rec need_parent t = match t.Types.desc with Types.Tarrow _ | Types.Ttuple _ -> true - | Types.Tlink t2 | Types.Tsubst t2 -> need_parent t2 + | Types.Tlink t2 | Types.Tsubst (t2, _) -> need_parent t2 | Types.Tconstr _ -> false (* | Types.Tvar | Types.Tunivar | Types.Tobject _ | Types.Tpoly _ *) @@ -120,7 +120,7 @@ let string_of_class_type_param_list ?margin l = let rec is_arrow_type t = match t.Types.desc with Types.Tarrow _ -> true - | Types.Tlink t2 | Types.Tsubst t2 -> is_arrow_type t2 + | Types.Tlink t2 | Types.Tsubst (t2, _) -> is_arrow_type t2 (* | Types.Ttuple _ *) (* | Types.Tconstr _ *) (* | Types.Tvar | Types.Tunivar | Types.Tobject _ | Types.Tpoly _ *) diff --git a/wikidoc.opam b/wikidoc.opam index c00d4f8..95ecee6 100644 --- a/wikidoc.opam +++ b/wikidoc.opam @@ -18,7 +18,7 @@ remove: [ [ "rm" "-f" "%{bin}%/latex_of_wiki" ] ] depends: [ - "ocaml" {>= "4.10.0" & < "4.13.0"} + "ocaml" {= "4.13.0"} "base-threads" "base-unix" "ocamlfind" From 858b91ba152320e69c173efb63833507e5df657f Mon Sep 17 00:00:00 2001 From: "Mohammad-Habib.Javaid" Date: Wed, 17 Jul 2024 16:47:00 +0200 Subject: [PATCH 2/4] fix warning due to argument that are not labelled --- src/odoc_wiki/odoc_wiki.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/odoc_wiki/odoc_wiki.ml b/src/odoc_wiki/odoc_wiki.ml index b83eae8..3ed2471 100644 --- a/src/odoc_wiki/odoc_wiki.ml +++ b/src/odoc_wiki/odoc_wiki.ml @@ -1291,7 +1291,7 @@ module Generator = struct | Type_record l -> bs b (" "^(self#delimiter "~=")^" "); if priv then bs b "private " ; - self#html_of_record b indent father l ; + self#html_of_record b ~indent ~father l ; ); bs b ">>"; self#html_of_info b t.ty_info; From 6524344c9b8d48a9d8924398c5510c764b8fde87 Mon Sep 17 00:00:00 2001 From: "Mohammad-Habib.Javaid" Date: Thu, 18 Jul 2024 14:30:59 +0200 Subject: [PATCH 3/4] fix errors due to the changes of the printtyp api --- src/odoc_wiki/odoc_import.ml | 15 ++++++--------- wikidoc.opam | 2 +- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/odoc_wiki/odoc_import.ml b/src/odoc_wiki/odoc_import.ml index 1614ffe..423b029 100644 --- a/src/odoc_wiki/odoc_import.ml +++ b/src/odoc_wiki/odoc_import.ml @@ -21,8 +21,7 @@ let (modtype_fmt, flush_modtype_fmt, modtype_set_margin) = new_fmt () let string_of_type_expr ?(margin = default_margin) t = type_set_margin margin; - Printtyp.mark_loops t; - Printtyp.type_scheme_max ~b_reset_names: false type_fmt t; + Printtyp.shared_type_scheme type_fmt t; flush_type_fmt () let raw_string_of_type_list ?(margin = default_margin) sep type_list = @@ -30,7 +29,7 @@ let raw_string_of_type_list ?(margin = default_margin) sep type_list = let fmt = Format.formatter_of_buffer buf in Format.pp_set_margin fmt margin; let rec need_parent t = - match t.Types.desc with + match Types.get_desc t with Types.Tarrow _ | Types.Ttuple _ -> true | Types.Tlink t2 | Types.Tsubst (t2, _) -> need_parent t2 | Types.Tconstr _ -> @@ -41,17 +40,16 @@ let raw_string_of_type_list ?(margin = default_margin) sep type_list = | _ -> false in let print_one_type variance t = - Printtyp.mark_loops t; if need_parent t then ( Format.fprintf fmt "(%s" variance; - Printtyp.type_scheme_max ~b_reset_names: false fmt t; + Printtyp.shared_type_scheme fmt t; Format.fprintf fmt ")" ) else ( Format.fprintf fmt "%s" variance; - Printtyp.type_scheme_max ~b_reset_names: false fmt t + Printtyp.shared_type_scheme fmt t ) in begin match type_list with @@ -118,7 +116,7 @@ let string_of_class_type_param_list ?margin l = (if par then "]" else "") let rec is_arrow_type t = - match t.Types.desc with + match Types.get_desc t with Types.Tarrow _ -> true | Types.Tlink t2 | Types.Tsubst (t2, _) -> is_arrow_type t2 (* | Types.Ttuple _ *) @@ -140,7 +138,6 @@ let string_of_class_params ?(margin = default_margin) c = Odoc_misc.remove_option t else t in - Printtyp.mark_loops t; Format.fprintf fmt "@[%s%s%a%s@] ->@ " ( match label with @@ -149,7 +146,7 @@ let string_of_class_params ?(margin = default_margin) c = | Asttypes.Optional s -> "?"^s^":" ) (if parent then "(" else "") (* TODO open_box ?*) - (Printtyp.type_scheme_max ~b_reset_names:false) ty + (Printtyp.shared_type_scheme) ty (if parent then ")" else ""); iter ctype | Types.Cty_signature _ diff --git a/wikidoc.opam b/wikidoc.opam index 95ecee6..06d3840 100644 --- a/wikidoc.opam +++ b/wikidoc.opam @@ -18,7 +18,7 @@ remove: [ [ "rm" "-f" "%{bin}%/latex_of_wiki" ] ] depends: [ - "ocaml" {= "4.13.0"} + "ocaml" {= "4.14.0" | = "4.14.1" | = "4.14.2"} "base-threads" "base-unix" "ocamlfind" From 7317ffee7544e3a6da289a5d787be3b45d104ff1 Mon Sep 17 00:00:00 2001 From: "Mohammad-Habib.Javaid" Date: Tue, 23 Jul 2024 12:13:04 +0200 Subject: [PATCH 4/4] Remove warning due to the lack of -package str --- src/odoc_wiki/Makefile | 4 ++-- wikidoc.opam | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/odoc_wiki/Makefile b/src/odoc_wiki/Makefile index 7adfcb9..816194b 100644 --- a/src/odoc_wiki/Makefile +++ b/src/odoc_wiki/Makefile @@ -8,9 +8,9 @@ OCAMLDUCEFIND ?= ocamlducefind OCAMLDOC ?= ${OCAMLFIND} ocamldoc OCAMLDUCEDOC ?= ${OCAMLDUCEFIND} ocamldoc -OCAMLC ?= ${OCAMLFIND} ocamlc +OCAMLC ?= ${OCAMLFIND} ocamlc -package str OCAMLDUCEC ?= ${OCAMLDUCEFIND} ocamlc -OCAMLOPT ?= ${OCAMLFIND} ocamlopt +OCAMLOPT ?= ${OCAMLFIND} ocamlopt -package str OCAMLDUCEOPT ?= ${OCAMLDUCEFIND} ocamlopt OCAMLDEP ?= ${OCAMLFIND} ocamldep OCAMLDUCEDEP ?= ${OCAMLDUCEFIND} ocamldep diff --git a/wikidoc.opam b/wikidoc.opam index 06d3840..a4085a9 100644 --- a/wikidoc.opam +++ b/wikidoc.opam @@ -18,7 +18,7 @@ remove: [ [ "rm" "-f" "%{bin}%/latex_of_wiki" ] ] depends: [ - "ocaml" {= "4.14.0" | = "4.14.1" | = "4.14.2"} + "ocaml" {>= "4.14.0" & < "5.1.0"} "base-threads" "base-unix" "ocamlfind"