summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--asmcomp/asmpackager.ml4
-rw-r--r--bytecomp/bytepackager.ml4
-rw-r--r--bytecomp/lambda.ml2
-rw-r--r--debugger/command_line.ml8
-rw-r--r--debugger/loadprinter.ml2
-rw-r--r--driver/compenv.ml2
-rw-r--r--ocamlbuild/display.ml4
-rw-r--r--ocamlbuild/loc.ml2
-rw-r--r--ocamlbuild/ocaml_specific.ml16
-rw-r--r--ocamlbuild/ocaml_utils.ml8
-rw-r--r--ocamlbuild/options.ml4
-rw-r--r--ocamldoc/odoc_analyse.ml6
-rw-r--r--ocamldoc/odoc_ast.ml2
-rw-r--r--ocamldoc/odoc_html.ml4
-rw-r--r--ocamldoc/odoc_latex.ml2
-rw-r--r--ocamldoc/odoc_man.ml2
-rw-r--r--ocamldoc/odoc_misc.ml2
-rw-r--r--ocamldoc/odoc_sig.ml2
-rw-r--r--ocamldoc/odoc_texi.ml2
-rw-r--r--otherlibs/dynlink/extract_crc.ml2
-rw-r--r--tools/ocamldep.ml4
-rw-r--r--toplevel/expunge.ml2
-rw-r--r--toplevel/toploop.ml2
-rw-r--r--typing/typemod.ml2
-rw-r--r--utils/misc.ml2
-rw-r--r--utils/warnings.ml8
26 files changed, 50 insertions, 50 deletions
diff --git a/asmcomp/asmpackager.ml b/asmcomp/asmpackager.ml
index d900df1e14..553d0fe137 100644
--- a/asmcomp/asmpackager.ml
+++ b/asmcomp/asmpackager.ml
@@ -38,7 +38,7 @@ type pack_member =
let read_member_info pack_path file = (
let name =
- String.capitalize(Filename.basename(chop_extensions file)) in
+ String.capitalize_ascii(Filename.basename(chop_extensions file)) in
let kind =
if Filename.check_suffix file ".cmx" then begin
let (info, crc) = Compilenv.read_unit_info file in
@@ -171,7 +171,7 @@ let package_files ppf initial_env files targetcmx =
let prefix = chop_extensions targetcmx in
let targetcmi = prefix ^ ".cmi" in
let targetobj = chop_extension_if_any targetcmx ^ Config.ext_obj in
- let targetname = String.capitalize(Filename.basename prefix) in
+ let targetname = String.capitalize_ascii(Filename.basename prefix) in
(* Set the name of the current "input" *)
Location.input_name := targetcmx;
(* Set the name of the current compunit *)
diff --git a/bytecomp/bytepackager.ml b/bytecomp/bytepackager.ml
index 05ebac9aad..d8493ab322 100644
--- a/bytecomp/bytepackager.ml
+++ b/bytecomp/bytepackager.ml
@@ -96,7 +96,7 @@ type pack_member =
let read_member_info file = (
let name =
- String.capitalize(Filename.basename(chop_extensions file)) in
+ String.capitalize_ascii(Filename.basename(chop_extensions file)) in
let kind =
if Filename.check_suffix file ".cmo" then begin
let ic = open_in_bin file in
@@ -261,7 +261,7 @@ let package_files ppf initial_env files targetfile =
files in
let prefix = chop_extensions targetfile in
let targetcmi = prefix ^ ".cmi" in
- let targetname = String.capitalize(Filename.basename prefix) in
+ let targetname = String.capitalize_ascii(Filename.basename prefix) in
try
let coercion =
Typemod.package_units initial_env files targetcmi targetname in
diff --git a/bytecomp/lambda.ml b/bytecomp/lambda.ml
index 577e82ddd6..c82801ff52 100644
--- a/bytecomp/lambda.ml
+++ b/bytecomp/lambda.ml
@@ -542,7 +542,7 @@ let lam_of_loc kind loc =
| Loc_MODULE ->
let filename = Filename.basename file in
let module_name =
- try String.capitalize (Filename.chop_extension filename)
+ try String.capitalize_ascii (Filename.chop_extension filename)
with Invalid_argument _ -> "//"^filename^"//"
in Lconst (Const_immstring module_name)
| Loc_LOC ->
diff --git a/debugger/command_line.ml b/debugger/command_line.ml
index a4647110d6..1867a6bdde 100644
--- a/debugger/command_line.ml
+++ b/debugger/command_line.ml
@@ -150,9 +150,9 @@ let convert_module mdle =
match mdle with
| Some m ->
(* Strip .ml extension if any, and capitalize *)
- String.capitalize(if Filename.check_suffix m ".ml"
- then Filename.chop_suffix m ".ml"
- else m)
+ String.capitalize_ascii(if Filename.check_suffix m ".ml"
+ then Filename.chop_suffix m ".ml"
+ else m)
| None ->
try
(get_current_event ()).ev_module
@@ -270,7 +270,7 @@ let instr_dir ppf lexbuf =
let new_directory' = List.rev new_directory in
match new_directory' with
| mdl :: for_keyw :: tl
- when (String.lowercase for_keyw) = "for" && (List.length tl) > 0 ->
+ when (String.lowercase_ascii for_keyw) = "for" && (List.length tl) > 0 ->
List.iter (function x -> add_path_for mdl (expand_path x)) tl
| _ ->
List.iter (function x -> add_path (expand_path x)) new_directory'
diff --git a/debugger/loadprinter.ml b/debugger/loadprinter.ml
index 98e79d7963..16d6e9f2b4 100644
--- a/debugger/loadprinter.ml
+++ b/debugger/loadprinter.ml
@@ -70,7 +70,7 @@ let rec loadfiles ppf name =
true
with
| Dynlink.Error (Dynlink.Unavailable_unit unit) ->
- loadfiles ppf (String.uncapitalize unit ^ ".cmo")
+ loadfiles ppf (String.uncapitalize_ascii unit ^ ".cmo")
&&
loadfiles ppf name
| Not_found ->
diff --git a/driver/compenv.ml b/driver/compenv.ml
index 82704fd8f9..49d180cc88 100644
--- a/driver/compenv.ml
+++ b/driver/compenv.ml
@@ -85,7 +85,7 @@ let module_of_filename ppf inputfile outputprefix =
String.sub basename 0 pos
with Not_found -> basename
in
- let name = String.capitalize name in
+ let name = String.capitalize_ascii name in
check_unit_name ppf inputfile name;
name
;;
diff --git a/ocamlbuild/display.ml b/ocamlbuild/display.ml
index 2e0b1e39ea..c295807e40 100644
--- a/ocamlbuild/display.ml
+++ b/ocamlbuild/display.ml
@@ -297,10 +297,10 @@ let update_tagline_from_tags ds =
done
| (tag, c) :: rest ->
if Tags.mem tag tags then
- Bytes.set tagline i (Char.uppercase c)
+ Bytes.set tagline i (Char.uppercase_ascii c)
else
if Tags.mem tag ds.ds_seen_tags then
- Bytes.set tagline i (Char.lowercase c)
+ Bytes.set tagline i (Char.lowercase_ascii c)
else
Bytes.set tagline i '-';
loop (i + 1) rest
diff --git a/ocamlbuild/loc.ml b/ocamlbuild/loc.ml
index 7a324c1618..c5ef9398d5 100644
--- a/ocamlbuild/loc.ml
+++ b/ocamlbuild/loc.ml
@@ -20,7 +20,7 @@ let print_loc ppf (source, start, end_) =
if one_or_two then fprintf ppf " %d" start_num
else fprintf ppf "s %d-%d" start_num end_num in
fprintf ppf "%s %S, line%a, character%a:@."
- (String.capitalize source)
+ (String.capitalize_ascii source)
(file start)
(print (line start = line end_))
(line start, line end_)
diff --git a/ocamlbuild/ocaml_specific.ml b/ocamlbuild/ocaml_specific.ml
index 1d0b8a8e47..68edd17870 100644
--- a/ocamlbuild/ocaml_specific.ml
+++ b/ocamlbuild/ocaml_specific.ml
@@ -731,17 +731,17 @@ flag ["ocaml"; "ocamllex"; "quiet"] (A"-q");;
let ocaml_warn_flag c =
flag ~deprecated:true
- ["ocaml"; "compile"; sprintf "warn_%c" (Char.uppercase c)]
- (S[A"-w"; A (sprintf "%c" (Char.uppercase c))]);
+ ["ocaml"; "compile"; sprintf "warn_%c" (Char.uppercase_ascii c)]
+ (S[A"-w"; A (sprintf "%c" (Char.uppercase_ascii c))]);
flag ~deprecated:true
- ["ocaml"; "compile"; sprintf "warn_error_%c" (Char.uppercase c)]
- (S[A"-warn-error"; A (sprintf "%c" (Char.uppercase c))]);
+ ["ocaml"; "compile"; sprintf "warn_error_%c" (Char.uppercase_ascii c)]
+ (S[A"-warn-error"; A (sprintf "%c" (Char.uppercase_ascii c))]);
flag ~deprecated:true
- ["ocaml"; "compile"; sprintf "warn_%c" (Char.lowercase c)]
- (S[A"-w"; A (sprintf "%c" (Char.lowercase c))]);
+ ["ocaml"; "compile"; sprintf "warn_%c" (Char.lowercase_ascii c)]
+ (S[A"-w"; A (sprintf "%c" (Char.lowercase_ascii c))]);
flag ~deprecated:true
- ["ocaml"; "compile"; sprintf "warn_error_%c" (Char.lowercase c)]
- (S[A"-warn-error"; A (sprintf "%c" (Char.lowercase c))]);;
+ ["ocaml"; "compile"; sprintf "warn_error_%c" (Char.lowercase_ascii c)]
+ (S[A"-warn-error"; A (sprintf "%c" (Char.lowercase_ascii c))]);;
List.iter ocaml_warn_flag ['A'; 'C'; 'D'; 'E'; 'F'; 'K'; 'L'; 'M'; 'P'; 'R'; 'S'; 'U'; 'V'; 'X'; 'Y'; 'Z'];;
diff --git a/ocamlbuild/ocaml_utils.ml b/ocamlbuild/ocaml_utils.ml
index 409f0a0694..5aedfb2c76 100644
--- a/ocamlbuild/ocaml_utils.ml
+++ b/ocamlbuild/ocaml_utils.ml
@@ -40,14 +40,14 @@ let pflag_and_dep tags ptag cmd_spec =
(fun param ->
flag_and_dep (Param_tags.make ptag param :: tags) (cmd_spec param))
-let module_name_of_filename f = String.capitalize (Pathname.remove_extensions f)
+let module_name_of_filename f = String.capitalize_ascii (Pathname.remove_extensions f)
let module_name_of_pathname x =
module_name_of_filename (Pathname.to_string (Pathname.basename x))
let ignore_stdlib x =
if !Options.nostdlib then false
else
- let x' = !*stdlib_dir/((String.uncapitalize x)-.-"cmi") in
+ let x' = !*stdlib_dir/((String.uncapitalize_ascii x)-.-"cmi") in
Pathname.exists x'
let non_dependencies = ref []
@@ -69,8 +69,8 @@ let expand_module =
memo3 (fun include_dirs module_name exts ->
let dirname = Pathname.dirname module_name in
let basename = Pathname.basename module_name in
- let module_name_cap = dirname/(String.capitalize basename) in
- let module_name_uncap = dirname/(String.uncapitalize basename) in
+ let module_name_cap = dirname/(String.capitalize_ascii basename) in
+ let module_name_uncap = dirname/(String.uncapitalize_ascii basename) in
List.fold_right begin fun include_dir ->
List.fold_right begin fun ext acc ->
include_dir/(module_name_uncap-.-ext) ::
diff --git a/ocamlbuild/options.ml b/ocamlbuild/options.ml
index 5193b9b904..ffef6a9b47 100644
--- a/ocamlbuild/options.ml
+++ b/ocamlbuild/options.ml
@@ -77,7 +77,7 @@ let mk_virtual_solvers =
List.iter begin fun cmd ->
let solver () =
A (find_tool cmd)
- in Command.setup_virtual_command_solver (String.uppercase cmd) solver
+ in Command.setup_virtual_command_solver (String.uppercase_ascii cmd) solver
end
let () =
@@ -353,7 +353,7 @@ let init () =
dir_reorder my_include_dirs include_dirs;
dir_reorder my_exclude_dirs exclude_dirs;
- ignore_list := List.map String.capitalize !ignore_list
+ ignore_list := List.map String.capitalize_ascii !ignore_list
;;
(* The current heuristic: we know we are in an ocamlbuild project if
diff --git a/ocamldoc/odoc_analyse.ml b/ocamldoc/odoc_analyse.ml
index fd69b0a74d..a5ce18cba0 100644
--- a/ocamldoc/odoc_analyse.ml
+++ b/ocamldoc/odoc_analyse.ml
@@ -62,7 +62,7 @@ let tool_name = "ocamldoc"
let process_implementation_file ppf sourcefile =
init_path ();
let prefixname = Filename.chop_extension sourcefile in
- let modulename = String.capitalize(Filename.basename prefixname) in
+ let modulename = String.capitalize_ascii(Filename.basename prefixname) in
Env.set_unit_name modulename;
let inputfile = preprocess sourcefile in
let env = initial_env () in
@@ -95,7 +95,7 @@ let process_implementation_file ppf sourcefile =
let process_interface_file ppf sourcefile =
init_path ();
let prefixname = Filename.chop_extension sourcefile in
- let modulename = String.capitalize(Filename.basename prefixname) in
+ let modulename = String.capitalize_ascii(Filename.basename prefixname) in
Env.set_unit_name modulename;
let inputfile = preprocess sourcefile in
let ast =
@@ -205,7 +205,7 @@ let process_file ppf sourcefile =
try Filename.chop_extension file
with _ -> file
in
- String.capitalize (Filename.basename s)
+ String.capitalize_ascii (Filename.basename s)
in
let txt =
try Odoc_text.Texter.text_of_string (Odoc_misc.input_file_as_string file)
diff --git a/ocamldoc/odoc_ast.ml b/ocamldoc/odoc_ast.ml
index ce71070efe..5bb5567e2d 100644
--- a/ocamldoc/odoc_ast.ml
+++ b/ocamldoc/odoc_ast.ml
@@ -1899,7 +1899,7 @@ module Analyser =
in
prepare_file complete_source_file input_file;
(* We create the t_module for this file. *)
- let mod_name = String.capitalize (Filename.basename (Filename.chop_extension source_file)) in
+ let mod_name = String.capitalize_ascii (Filename.basename (Filename.chop_extension source_file)) in
let (len,info_opt) = My_ir.first_special !file_name !file in
(* we must complete the included modules *)
diff --git a/ocamldoc/odoc_html.ml b/ocamldoc/odoc_html.ml
index 0c5293ea12..28f49c4abd 100644
--- a/ocamldoc/odoc_html.ml
+++ b/ocamldoc/odoc_html.ml
@@ -307,7 +307,7 @@ class virtual text =
method html_of_custom_text b s t = ()
method html_of_Target b ~target ~code =
- if String.lowercase target = "html" then bs b code else ()
+ if String.lowercase_ascii target = "html" then bs b code else ()
method html_of_Raw b s = bs b (self#escape s)
@@ -2312,7 +2312,7 @@ class html =
[] -> ()
| e :: _ ->
let s =
- match (Char.uppercase (Name.simple (name e)).[0]) with
+ match (Char.uppercase_ascii (Name.simple (name e)).[0]) with
'A'..'Z' as c -> String.make 1 c
| _ -> ""
in
diff --git a/ocamldoc/odoc_latex.ml b/ocamldoc/odoc_latex.ml
index b2145d1bc9..2273a6d0ab 100644
--- a/ocamldoc/odoc_latex.ml
+++ b/ocamldoc/odoc_latex.ml
@@ -293,7 +293,7 @@ class text =
method latex_of_custom_text fmt s t = ()
method latex_of_Target fmt ~target ~code =
- if String.lowercase target = "latex" then
+ if String.lowercase_ascii target = "latex" then
self#latex_of_Latex fmt code
else
()
diff --git a/ocamldoc/odoc_man.ml b/ocamldoc/odoc_man.ml
index 13733ba8e1..effe6c83b3 100644
--- a/ocamldoc/odoc_man.ml
+++ b/ocamldoc/odoc_man.ml
@@ -340,7 +340,7 @@ class man =
method man_of_custom_text b s t = ()
method man_of_Target b ~target ~code =
- if String.lowercase target = "man" then bs b code else ()
+ if String.lowercase_ascii target = "man" then bs b code else ()
(** Print groff string to display code. *)
method man_of_code b s = self#man_of_text b [ Code s ]
diff --git a/ocamldoc/odoc_misc.ml b/ocamldoc/odoc_misc.ml
index e938dbe679..0bc9ade459 100644
--- a/ocamldoc/odoc_misc.ml
+++ b/ocamldoc/odoc_misc.ml
@@ -454,7 +454,7 @@ let create_index_lists elements string_of_ele =
match s with
"" -> f current acc0 acc1 (acc2 @ [ele]) q
| _ ->
- let first = Char.uppercase s.[0] in
+ let first = Char.uppercase_ascii s.[0] in
match first with
'A' .. 'Z' ->
if current = first then
diff --git a/ocamldoc/odoc_sig.ml b/ocamldoc/odoc_sig.ml
index c2d3651184..87d4fe15bf 100644
--- a/ocamldoc/odoc_sig.ml
+++ b/ocamldoc/odoc_sig.ml
@@ -1520,7 +1520,7 @@ module Analyser =
in
prepare_file complete_source_file input_file;
(* We create the t_module for this file. *)
- let mod_name = String.capitalize
+ let mod_name = String.capitalize_ascii
(Filename.basename (try Filename.chop_extension source_file with _ -> source_file))
in
let (len,info_opt) = My_ir.first_special !file_name !file in
diff --git a/ocamldoc/odoc_texi.ml b/ocamldoc/odoc_texi.ml
index afa4d49f70..77489ec90b 100644
--- a/ocamldoc/odoc_texi.ml
+++ b/ocamldoc/odoc_texi.ml
@@ -311,7 +311,7 @@ class text =
method texi_of_custom_text s t = ""
method texi_of_Target ~target ~code =
- if String.lowercase target = "texi" then code else ""
+ if String.lowercase_ascii target = "texi" then code else ""
method texi_of_Verbatim s = s
method texi_of_Raw s = self#escape s
diff --git a/otherlibs/dynlink/extract_crc.ml b/otherlibs/dynlink/extract_crc.ml
index 4a6a310a95..d312aea711 100644
--- a/otherlibs/dynlink/extract_crc.ml
+++ b/otherlibs/dynlink/extract_crc.ml
@@ -20,7 +20,7 @@ let print_crc unit =
try
let crc = Dynlink.digest_interface unit (!load_path @ ["."]) in
if !first then first := false else print_string ";\n";
- print_string " \""; print_string (String.capitalize unit);
+ print_string " \""; print_string (String.capitalize_ascii unit);
print_string "\",\n \"";
for i = 0 to String.length crc - 1 do
Printf.printf "\\%03d" (Char.code crc.[i])
diff --git a/tools/ocamldep.ml b/tools/ocamldep.ml
index db0695c9c7..926dbe1293 100644
--- a/tools/ocamldep.ml
+++ b/tools/ocamldep.ml
@@ -78,7 +78,7 @@ let add_to_synonym_list synonyms suffix =
(* Find file 'name' (capitalized) in search path *)
let find_file name =
- let uname = String.uncapitalize name in
+ let uname = String.uncapitalize_ascii name in
let rec find_in_array a pos =
if pos >= Array.length a then None else begin
let s = a.(pos) in
@@ -331,7 +331,7 @@ let sort_files_by_dependencies files =
(* Init Hashtbl with all defined modules *)
let files = List.map (fun (file, file_kind, deps) ->
let modname =
- String.capitalize (Filename.chop_extension (Filename.basename file))
+ String.capitalize_ascii (Filename.chop_extension (Filename.basename file))
in
let key = (modname, file_kind) in
let new_deps = ref [] in
diff --git a/toplevel/expunge.ml b/toplevel/expunge.ml
index a893c60ddc..9496d56b27 100644
--- a/toplevel/expunge.ml
+++ b/toplevel/expunge.ml
@@ -44,7 +44,7 @@ let main () =
let input_name = Sys.argv.(1) in
let output_name = Sys.argv.(2) in
for i = (if negate then 4 else 3) to Array.length Sys.argv - 1 do
- to_keep := StringSet.add (String.capitalize Sys.argv.(i)) !to_keep
+ to_keep := StringSet.add (String.capitalize_ascii Sys.argv.(i)) !to_keep
done;
let ic = open_in_bin input_name in
Bytesections.read_toc ic;
diff --git a/toplevel/toploop.ml b/toplevel/toploop.ml
index f821072eb2..eea10004c6 100644
--- a/toplevel/toploop.ml
+++ b/toplevel/toploop.ml
@@ -116,7 +116,7 @@ let input_name = Location.input_name
let parse_mod_use_file name lb =
let modname =
- String.capitalize (Filename.chop_extension (Filename.basename name))
+ String.capitalize_ascii (Filename.chop_extension (Filename.basename name))
in
let items =
List.concat
diff --git a/typing/typemod.ml b/typing/typemod.ml
index 08cef79a7d..05ce06f903 100644
--- a/typing/typemod.ml
+++ b/typing/typemod.ml
@@ -1623,7 +1623,7 @@ let package_units initial_env objfiles cmifile modulename =
List.map
(fun f ->
let pref = chop_extensions f in
- let modname = String.capitalize(Filename.basename pref) in
+ let modname = String.capitalize_ascii(Filename.basename pref) in
let sg = Env.read_signature modname (pref ^ ".cmi") in
if Filename.check_suffix f ".cmi" &&
not(Mtype.no_code_needed_sig Env.initial_safe_string sg)
diff --git a/utils/misc.ml b/utils/misc.ml
index d3c0e1bc56..997508f854 100644
--- a/utils/misc.ml
+++ b/utils/misc.ml
@@ -104,7 +104,7 @@ let find_in_path_rel path name =
in try_dir path
let find_in_path_uncap path name =
- let uname = String.uncapitalize name in
+ let uname = String.uncapitalize_ascii name in
let rec try_dir = function
[] -> raise Not_found
| dir::rem ->
diff --git a/utils/warnings.ml b/utils/warnings.ml
index ff13c77650..0547f21c95 100644
--- a/utils/warnings.ml
+++ b/utils/warnings.ml
@@ -206,7 +206,7 @@ let parse_opt error active flags s =
if i >= String.length s then () else
match s.[i] with
| 'A' .. 'Z' ->
- List.iter set (letter (Char.lowercase s.[i]));
+ List.iter set (letter (Char.lowercase_ascii s.[i]));
loop (i+1)
| 'a' .. 'z' ->
List.iter clear (letter s.[i]);
@@ -223,7 +223,7 @@ let parse_opt error active flags s =
for n = n1 to min n2 last_warning_number do myset n done;
loop i
| 'A' .. 'Z' ->
- List.iter myset (letter (Char.lowercase s.[i]));
+ List.iter myset (letter (Char.lowercase_ascii s.[i]));
loop (i+1)
| 'a' .. 'z' ->
List.iter myset (letter s.[i]);
@@ -489,10 +489,10 @@ let help_warnings () =
match letter c with
| [] -> ()
| [n] ->
- Printf.printf " %c Synonym for warning %i.\n" (Char.uppercase c) n
+ Printf.printf " %c Synonym for warning %i.\n" (Char.uppercase_ascii c) n
| l ->
Printf.printf " %c Set of warnings %s.\n"
- (Char.uppercase c)
+ (Char.uppercase_ascii c)
(String.concat ", " (List.map string_of_int l))
done;
exit 0