OCaml 5.1 support

This commit is contained in:
Etienne Millon 2023-03-07 16:32:02 +01:00 committed by Etienne Millon
parent 4eba6f132b
commit 846af28b3c
2 changed files with 10 additions and 7 deletions

View File

@ -130,3 +130,12 @@ let iter_structure expr =
end) in
Search.iter_structure
#endif
(** Returns whether the given path is persistent. *)
let rec is_persistent_path = function
| Path.Pident id -> Ident.persistent id
| Path.Pdot (p, _) -> is_persistent_path p
| Path.Papply (_, p) -> is_persistent_path p
#if OCAML_VERSION >= (5, 1, 0)
| Path.Pextra_ty (p, _) -> is_persistent_path p
#endif

View File

@ -634,12 +634,6 @@ let rule_path rule =
with _ ->
None
(* Returns whether the given path is persistent. *)
let rec is_persistent_path = function
| Path.Pident id -> Ident.persistent id
| Path.Pdot (p, _) -> is_persistent_path p
| Path.Papply (_, p) -> is_persistent_path p
(* Check that the given long identifier is present in the environment
and is persistent. *)
let is_persistent_in_env longident =
@ -1512,7 +1506,7 @@ let protocol_version = 1
let main_aux ~initial_env =
Arg.parse args file_argument usage;
#if OCAML_VERSION >= (5, 0, 0)
#if OCAML_VERSION >= (5, 0, 0) && OCAML_VERSION < (5, 1, 0)
Topcommon.load_topdirs_signature ();
#endif
if not (prepare ()) then exit 2;