aboutsummaryrefslogtreecommitdiff
path: root/plugins/extraction/table.ml
diff options
context:
space:
mode:
authorPierre Letouzey2017-02-07 23:28:36 +0100
committerPierre Letouzey2017-02-07 23:28:36 +0100
commit3550120641c3b8d84290dc950e717aaf099775f9 (patch)
tree18381a0e6638a988acacce3cd51836d1641fb280 /plugins/extraction/table.ml
parentdf14dac0e6e9d9819dcc3b1601e150af7c142597 (diff)
Revert "Extraction: avoid deprecated functions of module String"
This reverts commit 69c4e7cfa0271f024b2178082e4be2e3ca3be263. String.capitalize_ascii are only available for ocaml >= 4.03, sorry...
Diffstat (limited to 'plugins/extraction/table.ml')
-rw-r--r--plugins/extraction/table.ml11
1 files changed, 5 insertions, 6 deletions
diff --git a/plugins/extraction/table.ml b/plugins/extraction/table.ml
index a8d49ffda5..5e7d810c93 100644
--- a/plugins/extraction/table.ml
+++ b/plugins/extraction/table.ml
@@ -55,7 +55,7 @@ let is_modfile = function
| _ -> false
let raw_string_of_modfile = function
- | MPfile f -> String.capitalize_ascii (Id.to_string (List.hd (DirPath.repr f)))
+ | MPfile f -> String.capitalize (Id.to_string (List.hd (DirPath.repr f)))
| _ -> assert false
let is_toplevel mp =
@@ -773,14 +773,13 @@ let file_of_modfile mp =
| MPfile f -> Id.to_string (List.hd (DirPath.repr f))
| _ -> assert false
in
- let s = Bytes.of_string (string_of_modfile mp) in
- let () = Bytes.set s 0 (s0.[0]) in
- Bytes.to_string s
+ let s = String.copy (string_of_modfile mp) in
+ if s.[0] != s0.[0] then s.[0] <- s0.[0];
+ s
let add_blacklist_entries l =
blacklist_table :=
- List.fold_right
- (fun s -> Id.Set.add (Id.of_string (String.capitalize_ascii s)))
+ List.fold_right (fun s -> Id.Set.add (Id.of_string (String.capitalize s)))
l !blacklist_table
(* Registration of operations for rollback. *)