diff options
| author | Gaëtan Gilbert | 2017-05-28 13:34:42 +0200 |
|---|---|---|
| committer | Gaëtan Gilbert | 2017-05-28 20:00:47 +0200 |
| commit | b30a6b141fed01a62330051bfb92c19564c93215 (patch) | |
| tree | ec73a2a0daf06891572f8117dc42978f1b2e7396 /plugins/extraction/common.ml | |
| parent | c53bc951c39b9d4ebcee0128c452fce7c8e4f92f (diff) | |
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]
Diffstat (limited to 'plugins/extraction/common.ml')
| -rw-r--r-- | plugins/extraction/common.ml | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/plugins/extraction/common.ml b/plugins/extraction/common.ml index fc8d5356c8..c498eb5890 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 |
