diff options
author | Pierre Letouzey <pierre.letouzey@inria.fr> | 2017-02-05 01:46:41 +0100 |
---|---|---|
committer | Pierre Letouzey <pierre.letouzey@inria.fr> | 2017-02-07 22:56:56 +0100 |
commit | 69c4e7cfa0271f024b2178082e4be2e3ca3be263 (patch) | |
tree | 011f39f68dcc1da8c622adf32931ca084a2f8c15 /plugins/extraction/table.ml | |
parent | 8ef3bc0e8a65b3a0338da39aa54cd75b1c2c1bb7 (diff) |
Extraction: avoid deprecated functions of module String
- A few tweaks of string are now done via the Bytes module
- lots of String.capitalize_ascii and co
Diffstat (limited to 'plugins/extraction/table.ml')
-rw-r--r-- | plugins/extraction/table.ml | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/plugins/extraction/table.ml b/plugins/extraction/table.ml index 5e7d810c9..a8d49ffda 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 (Id.to_string (List.hd (DirPath.repr f))) + | MPfile f -> String.capitalize_ascii (Id.to_string (List.hd (DirPath.repr f))) | _ -> assert false let is_toplevel mp = @@ -773,13 +773,14 @@ let file_of_modfile mp = | MPfile f -> Id.to_string (List.hd (DirPath.repr f)) | _ -> assert false in - let s = String.copy (string_of_modfile mp) in - if s.[0] != s0.[0] then s.[0] <- s0.[0]; - s + let s = Bytes.of_string (string_of_modfile mp) in + let () = Bytes.set s 0 (s0.[0]) in + Bytes.to_string s 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 (String.capitalize_ascii s))) l !blacklist_table (* Registration of operations for rollback. *) |