aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Camlcoq.ml
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2016-06-21 15:49:07 +0200
committerBernhard Schommer <bernhardschommer@gmail.com>2016-06-21 15:49:07 +0200
commit7237ccb621d58b2c86ef250f1c3e3ffd29260955 (patch)
treee770b9a015468751e0b006496fa7518402c88c96 /lib/Camlcoq.ml
parent8f444dec7112e5b125bf3ead8481ae0f698bbb96 (diff)
downloadcompcert-kvx-7237ccb621d58b2c86ef250f1c3e3ffd29260955.tar.gz
compcert-kvx-7237ccb621d58b2c86ef250f1c3e3ffd29260955.zip
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
Diffstat (limited to 'lib/Camlcoq.ml')
-rw-r--r--lib/Camlcoq.ml10
1 files changed, 10 insertions, 0 deletions
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 =