From 7237ccb621d58b2c86ef250f1c3e3ffd29260955 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Tue, 21 Jun 2016 15:49:07 +0200 Subject: Remove code that will is deprecated in ocaml 4.03 Most of the code can be String.uppercase usages can either be replaced by a more specialized version of coqstring_of_camlstring (which is also slightly more effecient) or by specialized checks that reject wrong code earlier. Bug 19187 --- lib/Camlcoq.ml | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/Camlcoq.ml') diff --git a/lib/Camlcoq.ml b/lib/Camlcoq.ml index 90c3ab3f..7e8a1018 100644 --- a/lib/Camlcoq.ml +++ b/lib/Camlcoq.ml @@ -318,6 +318,16 @@ let coqstring_of_camlstring s = if pos < 0 then accu else cstring (s.[pos] :: accu) (pos - 1) in cstring [] (String.length s - 1) +let coqstring_uppercase_ascii_of_camlstring s = + let rec cstring accu pos = + if pos < 0 then accu else + let d = if s.[pos] >= 'a' && s.[pos] <= 'z' then + Char.chr (Char.code s.[pos] - 32) + else + s.[pos] in + cstring (d :: accu) (pos - 1) + in cstring [] (String.length s - 1) + (* Floats *) let coqfloat_of_camlfloat f = -- cgit