From b30a6b141fed01a62330051bfb92c19564c93215 Mon Sep 17 00:00:00 2001 From: Gaƫtan Gilbert Date: Sun, 28 May 2017 13:34:42 +0200 Subject: Fail on deprecated warning even for Ocaml > 4.02.3 Deprecations which can't be fixed in 4.02.3 are locally wrapped with [@@@ocaml.warning "-3"]. The only ones encountered are - capitalize to capitalize_ascii and variants. Changing to ascii would break coqdoc -latin1 and maybe other things though. - external "noalloc" to external [@@noalloc] --- plugins/extraction/common.ml | 9 +++++++-- plugins/extraction/haskell.ml | 3 ++- plugins/extraction/table.ml | 9 +++++++-- 3 files changed, 16 insertions(+), 5 deletions(-) (limited to 'plugins/extraction') diff --git a/plugins/extraction/common.ml b/plugins/extraction/common.ml index fc8d5356c..c498eb589 100644 --- a/plugins/extraction/common.ml +++ b/plugins/extraction/common.ml @@ -109,12 +109,17 @@ let pseudo_qualify = qualify "__" let is_upper s = match s.[0] with 'A' .. 'Z' -> true | _ -> false let is_lower s = match s.[0] with 'a' .. 'z' | '_' -> true | _ -> false -let lowercase_id id = Id.of_string (String.uncapitalize (ascii_of_id id)) +[@@@ocaml.warning "-3"] (* String.(un)capitalize_ascii since 4.03.0 GPR#124 *) +let capitalize = String.capitalize +let uncapitalize = String.uncapitalize +[@@@ocaml.warning "+3"] + +let lowercase_id id = Id.of_string (uncapitalize (ascii_of_id id)) let uppercase_id id = let s = ascii_of_id id in assert (not (String.is_empty s)); if s.[0] == '_' then Id.of_string ("Coq_"^s) - else Id.of_string (String.capitalize s) + else Id.of_string (capitalize s) type kind = Term | Type | Cons | Mod diff --git a/plugins/extraction/haskell.ml b/plugins/extraction/haskell.ml index 0692c88cd..fc1b5f8db 100644 --- a/plugins/extraction/haskell.ml +++ b/plugins/extraction/haskell.ml @@ -20,9 +20,10 @@ open Mlutil open Common (*s Haskell renaming issues. *) - +[@@@ocaml.warning "-3"] (* String.(un)capitalize_ascii since 4.03.0 GPR#124 *) let pr_lower_id id = str (String.uncapitalize (Id.to_string id)) let pr_upper_id id = str (String.capitalize (Id.to_string id)) +[@@@ocaml.warning "+3"] let keywords = List.fold_right (fun s -> Id.Set.add (Id.of_string s)) diff --git a/plugins/extraction/table.ml b/plugins/extraction/table.ml index fc1ed335a..a369cbdf3 100644 --- a/plugins/extraction/table.ml +++ b/plugins/extraction/table.ml @@ -20,6 +20,11 @@ open Util open Pp open Miniml +[@@@ocaml.warning "-3"] (* String.capitalize_ascii since 4.03.0 GPR#124 *) +let capitalize = String.capitalize +[@@@ocaml.warning "+3"] + + (** Sets and maps for [global_reference] that use the "user" [kernel_name] instead of the canonical one *) @@ -55,7 +60,7 @@ let is_modfile = function | _ -> false let raw_string_of_modfile = function - | MPfile f -> String.capitalize (Id.to_string (List.hd (DirPath.repr f))) + | MPfile f -> capitalize (Id.to_string (List.hd (DirPath.repr f))) | _ -> assert false let is_toplevel mp = @@ -772,7 +777,7 @@ let file_of_modfile mp = let add_blacklist_entries l = blacklist_table := - List.fold_right (fun s -> Id.Set.add (Id.of_string (String.capitalize s))) + List.fold_right (fun s -> Id.Set.add (Id.of_string (capitalize s))) l !blacklist_table (* Registration of operations for rollback. *) -- cgit v1.2.3