diff options
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/coqdep.ml | 2 | ||||
| -rw-r--r-- | tools/coqdep_common.ml | 6 | ||||
| -rw-r--r-- | tools/coqdep_lexer.mll | 10 | ||||
| -rw-r--r-- | tools/coqdoc/alpha.ml | 10 | ||||
| -rw-r--r-- | tools/coqdoc/index.ml | 6 | ||||
| -rw-r--r-- | tools/coqdoc/output.ml | 10 | ||||
| -rw-r--r-- | tools/coqmktop.ml | 11 | ||||
| -rw-r--r-- | tools/ocamllibdep.mll | 10 |
8 files changed, 47 insertions, 18 deletions
diff --git a/tools/coqdep.ml b/tools/coqdep.ml index 930b092d3b..044399544a 100644 --- a/tools/coqdep.ml +++ b/tools/coqdep.ml @@ -495,7 +495,7 @@ let coqdep () = add_rec_dir_import (fun _ -> add_caml_known) "theories" ["Coq"]; add_rec_dir_import (fun _ -> add_caml_known) "plugins" ["Coq"]; end else begin - Envars.set_coqlib ~fail:CErrors.error; + Envars.set_coqlib ~fail:(fun msg -> CErrors.user_err Pp.(str msg)); let coqlib = Envars.coqlib () in add_rec_dir_import add_coqlib_known (coqlib//"theories") ["Coq"]; add_rec_dir_import add_coqlib_known (coqlib//"plugins") ["Coq"]; diff --git a/tools/coqdep_common.ml b/tools/coqdep_common.ml index 6e7935d099..f5e93527c9 100644 --- a/tools/coqdep_common.ml +++ b/tools/coqdep_common.ml @@ -36,6 +36,10 @@ let norec_dirs = ref StrSet.empty let suffixe = ref ".vo" +[@@@ocaml.warning "-3"] (* String.capitalize_ascii since 4.03.0 GPR#124 *) +let capitalize = String.capitalize +[@@@ocaml.warning "+3"] + type dir = string option (** [get_extension f l] checks whether [f] has one of the extensions @@ -455,7 +459,7 @@ let mL_dependencies () = printf "%s_MLPACK_DEPENDENCIES:=%s\n" efullname (String.concat " " dep); printf "%s.cmo:$(addsuffix .cmo,$(%s_MLPACK_DEPENDENCIES))\n" efullname efullname; printf "%s.cmx:$(addsuffix .cmx,$(%s_MLPACK_DEPENDENCIES))\n" efullname efullname; - let efullname_capital = String.capitalize (Filename.basename efullname) in + let efullname_capital = capitalize (Filename.basename efullname) in List.iter (fun dep -> printf "%s.cmx : FOR_PACK=-for-pack %s\n" dep efullname_capital) dep; diff --git a/tools/coqdep_lexer.mll b/tools/coqdep_lexer.mll index eb233b8f94..c68c34bbbd 100644 --- a/tools/coqdep_lexer.mll +++ b/tools/coqdep_lexer.mll @@ -39,6 +39,10 @@ let syntax_error lexbuf = raise (Syntax_error (Lexing.lexeme_start lexbuf, Lexing.lexeme_end lexbuf)) + + [@@@ocaml.warning "-3"] (* String.uncapitalize_ascii since 4.03.0 GPR#124 *) + let uncapitalize = String.uncapitalize + [@@@ocaml.warning "+3"] } let space = [' ' '\t' '\n' '\r'] @@ -154,7 +158,7 @@ and caml_action = parse | space + { caml_action lexbuf } | "open" space* (caml_up_ident as id) - { Use_module (String.uncapitalize id) } + { Use_module (uncapitalize id) } | "module" space+ caml_up_ident { caml_action lexbuf } | caml_low_ident { caml_action lexbuf } @@ -321,12 +325,12 @@ and modules mllist = parse and qual_id ml_module_name = parse | '.' [^ '.' '(' '['] - { Use_module (String.uncapitalize ml_module_name) } + { Use_module (uncapitalize ml_module_name) } | eof { raise Fin_fichier } | _ { caml_action lexbuf } and mllib_list = parse - | caml_up_ident { let s = String.uncapitalize (Lexing.lexeme lexbuf) + | caml_up_ident { let s = uncapitalize (Lexing.lexeme lexbuf) in s :: mllib_list lexbuf } | "*predef*" { mllib_list lexbuf } | space+ { mllib_list lexbuf } diff --git a/tools/coqdoc/alpha.ml b/tools/coqdoc/alpha.ml index 3d92c9356b..6a6db95567 100644 --- a/tools/coqdoc/alpha.ml +++ b/tools/coqdoc/alpha.ml @@ -8,7 +8,11 @@ open Cdglobals -let norm_char_latin1 c = match Char.uppercase c with +[@@@ocaml.warning "-3"] (* Char.uppercase_ascii since 4.03.0 GPR#124 *) +let uppercase = Char.uppercase +[@@@ocaml.warning "+3"] + +let norm_char_latin1 c = match uppercase c with | '\192'..'\198' -> 'A' | '\199' -> 'C' | '\200'..'\203' -> 'E' @@ -19,12 +23,12 @@ let norm_char_latin1 c = match Char.uppercase c with | '\221' -> 'Y' | c -> c -let norm_char_utf8 c = Char.uppercase c +let norm_char_utf8 c = uppercase c let norm_char c = if !utf8 then norm_char_utf8 c else if !latin1 then norm_char_latin1 c else - Char.uppercase c + uppercase c let norm_string = String.map (fun s -> norm_char s) diff --git a/tools/coqdoc/index.ml b/tools/coqdoc/index.ml index 34108eff42..4d118b9788 100644 --- a/tools/coqdoc/index.ml +++ b/tools/coqdoc/index.ml @@ -155,10 +155,14 @@ let sort_entries el = let display_letter c = if c = '*' then "other" else String.make 1 c +[@@@ocaml.warning "-3"] (* String.lowercase_ascii since 4.03.0 GPR#124 *) +let lowercase = String.lowercase +[@@@ocaml.warning "+3"] + let type_name = function | Library -> let ln = !lib_name in - if ln <> "" then String.lowercase ln else "library" + if ln <> "" then lowercase ln else "library" | Module -> "module" | Definition -> "definition" | Inductive -> "inductive" diff --git a/tools/coqdoc/output.ml b/tools/coqdoc/output.ml index e06ef9d765..9723905790 100644 --- a/tools/coqdoc/output.ml +++ b/tools/coqdoc/output.ml @@ -19,6 +19,10 @@ let printf s = Printf.fprintf !out_channel s let sprintf = Printf.sprintf +[@@@ocaml.warning "-3"] (* String.{capitalize,lowercase}_ascii since 4.03.0 GPR#124 *) +let capitalize = String.capitalize +let lowercase = String.lowercase +[@@@ocaml.warning "+3"] (*s Coq keywords *) @@ -846,7 +850,7 @@ module Html = struct if t = Library then let ln = !lib_name in if ln <> "" then - "[" ^ String.lowercase ln ^ "]", m ^ ".html", t + "[" ^ lowercase ln ^ "]", m ^ ".html", t else "[library]", m ^ ".html", t else @@ -864,7 +868,7 @@ module Html = struct (* Impression de la table d'index *) let print_index_table_item i = - printf "<tr>\n<td>%s Index</td>\n" (String.capitalize i.idx_name); + printf "<tr>\n<td>%s Index</td>\n" (capitalize i.idx_name); List.iter (fun (c,l) -> if l <> [] then @@ -912,7 +916,7 @@ module Html = struct let print_table () = print_index_table all_index in let print_one_index i = if i.idx_size > 0 then begin - printf "<hr/>\n<h1>%s Index</h1>\n" (String.capitalize i.idx_name); + printf "<hr/>\n<h1>%s Index</h1>\n" (capitalize i.idx_name); all_letters i end in diff --git a/tools/coqmktop.ml b/tools/coqmktop.ml index 7fa8fd58db..cd04665cc1 100644 --- a/tools/coqmktop.ml +++ b/tools/coqmktop.ml @@ -20,6 +20,10 @@ let split_list = let spaces = Str.regexp "[ \t\n]+" in fun str -> Str.split spaces str +[@@@ocaml.warning "-3"] (* String.uncapitalize_ascii since 4.03.0 GPR#124 *) +let capitalize = String.capitalize +[@@@ocaml.warning "+3"] + let (/) = Filename.concat (** Which user files do we support (and propagate to ocamlopt) ? @@ -39,8 +43,7 @@ let native_suffix f = match CUnix.get_extension f with (** Transforms a file name in the corresponding Caml module name. *) let module_of_file name = - String.capitalize - (try Filename.chop_extension name with Invalid_argument _ -> name) + capitalize (try Filename.chop_extension name with Invalid_argument _ -> name) (** Run a command [prog] with arguments [args]. We do not use [Sys.command] anymore, see comment in [CUnix.sys_command]. @@ -227,7 +230,7 @@ let declare_loading_string () = \n Mltop.set_top\ \n {Mltop.load_obj=\ \n (fun f -> if not (Topdirs.load_file ppf f)\ -\n then CErrors.error (\"Could not load plugin \"^f));\ +\n then CErrors.user_err Pp.(str (\"Could not load plugin \"^f)));\ \n Mltop.use_file=Topdirs.dir_use ppf;\ \n Mltop.add_dir=Topdirs.dir_directory;\ \n Mltop.ml_loop=(fun () -> Toploop.loop ppf) };;\ @@ -257,7 +260,7 @@ let create_tmp_main_file modules = let main () = let (options, userfiles) = parse_args () in (* Directories: *) - let () = Envars.set_coqlib ~fail:CErrors.error in + let () = Envars.set_coqlib ~fail:(fun x -> CErrors.user_err Pp.(str x)) in let basedir = if !Flags.boot then None else Some (Envars.coqlib ()) in (* Which ocaml compiler to invoke *) let prog = if !opt then "opt" else "ocamlc" in diff --git a/tools/ocamllibdep.mll b/tools/ocamllibdep.mll index bf82be09f1..f8b204c0b1 100644 --- a/tools/ocamllibdep.mll +++ b/tools/ocamllibdep.mll @@ -11,6 +11,12 @@ let syntax_error lexbuf = raise (Syntax_error (Lexing.lexeme_start lexbuf, Lexing.lexeme_end lexbuf)) + + [@@@ocaml.warning "-3"] (* String.(un)capitalize_ascii since 4.03.0 GPR#124 *) + let uncapitalize = String.uncapitalize + + let capitalize = String.capitalize + [@@@ocaml.warning "+3"] } let space = [' ' '\t' '\n' '\r'] @@ -22,7 +28,7 @@ let caml_up_ident = uppercase identchar* let caml_low_ident = lowercase identchar* rule mllib_list = parse - | caml_up_ident { let s = String.uncapitalize (Lexing.lexeme lexbuf) + | caml_up_ident { let s = uncapitalize (Lexing.lexeme lexbuf) in s :: mllib_list lexbuf } | "*predef*" { mllib_list lexbuf } | space+ { mllib_list lexbuf } @@ -185,7 +191,7 @@ let mlpack_dependencies () = List.iter (fun (name,dirname) -> let fullname = file_name name dirname in - let modname = String.capitalize name in + let modname = capitalize name in let deps = traite_fichier_modules fullname ".mlpack" in let sdeps = String.concat " " deps in let efullname = escape fullname in |
