aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
authorGravatar glondu <glondu@85f007b7-540e-0410-9357-904b9bb8a0f7>2009-09-17 15:58:14 +0000
committerGravatar glondu <glondu@85f007b7-540e-0410-9357-904b9bb8a0f7>2009-09-17 15:58:14 +0000
commit61ccbc81a2f3b4662ed4a2bad9d07d2003dda3a2 (patch)
tree961cc88c714aa91a0276ea9fbf8bc53b2b9d5c28 /scripts
parent6d3fbdf36c6a47b49c2a4b16f498972c93c07574 (diff)
Delete trailing whitespaces in all *.{v,ml*} files
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12337 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'scripts')
-rw-r--r--scripts/coqc.ml44
-rw-r--r--scripts/coqmktop.ml52
2 files changed, 48 insertions, 48 deletions
diff --git a/scripts/coqc.ml b/scripts/coqc.ml
index 64a3dcf91..6281f01eb 100644
--- a/scripts/coqc.ml
+++ b/scripts/coqc.ml
@@ -9,7 +9,7 @@
(* $Id$ *)
(* Afin de rendre Coq plus portable, ce programme Caml remplace le script
- coqc.
+ coqc.
Ici, on trie la ligne de commande pour en extraire les fichiers à compiler,
puis on les compile un par un en passant le reste de la ligne de commande
@@ -46,12 +46,12 @@ let check_module_name s =
else
(output_string stderr"'"; output_char stderr c; output_string stderr"'");
output_string stderr " is not allowed in module names\n";
- exit 1
+ exit 1
in
- match String.get s 0 with
- | 'a' .. 'z' | 'A' .. 'Z' ->
+ match String.get s 0 with
+ | 'a' .. 'z' | 'A' .. 'Z' ->
for i = 1 to (String.length s)-1 do
- match String.get s i with
+ match String.get s i with
| 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' -> ()
| c -> err c
done
@@ -59,7 +59,7 @@ let check_module_name s =
let rec make_compilation_args = function
| [] -> []
- | file :: fl ->
+ | file :: fl ->
let dirname = Filename.dirname file in
let basename = Filename.basename file in
let modulename =
@@ -78,14 +78,14 @@ let rec make_compilation_args = function
let compile command args files =
let args' = command :: args @ (make_compilation_args files) in
match Sys.os_type with
- | "Win32" ->
- let pid =
+ | "Win32" ->
+ let pid =
Unix.create_process_env command (Array.of_list args') environment
- Unix.stdin Unix.stdout Unix.stderr
+ Unix.stdin Unix.stdout Unix.stderr
in
ignore (Unix.waitpid [] pid)
| _ ->
- Unix.execvpe command (Array.of_list args') environment
+ Unix.execvpe command (Array.of_list args') environment
(* parsing of the command line
*
@@ -99,13 +99,13 @@ let usage () =
let parse_args () =
let rec parse (cfiles,args) = function
- | [] ->
+ | [] ->
List.rev cfiles, List.rev args
- | "-i" :: rem ->
+ | "-i" :: rem ->
specification := true ; parse (cfiles,args) rem
- | "-t" :: rem ->
+ | "-t" :: rem ->
keep := true ; parse (cfiles,args) rem
- | ("-verbose" | "--verbose") :: rem ->
+ | ("-verbose" | "--verbose") :: rem ->
verbose := true ; parse (cfiles,args) rem
| "-boot" :: rem ->
Flags.boot := true;
@@ -142,11 +142,11 @@ let parse_args () =
|"-batch"|"-nois"|"-noglob"|"-no-glob"
|"-q"|"-full"|"-profile"|"-just-parsing"|"-echo" |"-unsafe"|"-quiet"
|"-silent"|"-m"|"-xml"|"-v7"|"-v8"|"-beautify"|"-strict-implicit"
- |"-dont-load-proofs"|"-impredicative-set"|"-vm"
+ |"-dont-load-proofs"|"-impredicative-set"|"-vm"
|"-unboxed-values"|"-unboxed-definitions"|"-draw-vm-instr" as o) :: rem ->
parse (cfiles,o::args) rem
-
- | ("-where") :: _ ->
+
+ | ("-where") :: _ ->
(try print_endline (Envars.coqlib ())
with Util.UserError(_,pps) -> Pp.msgerrnl (Pp.hov 0 pps));
exit 0
@@ -155,10 +155,10 @@ let parse_args () =
| ("-v"|"--version") :: _ ->
Usage.version ()
- | f :: rem ->
+ | f :: rem ->
if Sys.file_exists f then
parse (f::cfiles,args) rem
- else
+ else
let fv = f ^ ".v" in
if Sys.file_exists fv then
parse (fv::cfiles,args) rem
@@ -178,11 +178,11 @@ let main () =
prerr_endline "coqc: too few arguments" ;
usage ()
end;
- let coqtopname =
- if !image <> "" then !image
+ let coqtopname =
+ if !image <> "" then !image
else Filename.concat (Envars.coqbin ()) (!binary ^ Coq_config.exec_extension)
in
(* List.iter (compile coqtopname args) cfiles*)
Unix.handle_unix_error (compile coqtopname args) cfiles
-
+
let _ = Printexc.print main (); exit 0
diff --git a/scripts/coqmktop.ml b/scripts/coqmktop.ml
index 50059ae17..936e159de 100644
--- a/scripts/coqmktop.ml
+++ b/scripts/coqmktop.ml
@@ -51,28 +51,28 @@ let searchisos = ref false
let coqide = ref false
let echo = ref false
-let src_dirs () =
+let src_dirs () =
[ []; ["kernel";"byterun"]; [ "config" ]; [ "toplevel" ] ] @
if !coqide then [[ "ide" ]] else []
-let includes () =
+let includes () =
let coqlib = Envars.coqlib () in
let camlp4lib = Envars.camlp4lib () in
List.fold_right
(fun d l -> "-I" :: ("\"" ^ List.fold_left Filename.concat coqlib d ^ "\"") :: l)
(src_dirs ())
- (["-I"; "\"" ^ camlp4lib ^ "\""] @
+ (["-I"; "\"" ^ camlp4lib ^ "\""] @
["-I"; "\"" ^ coqlib ^ "\""] @
(if !coqide then ["-thread"; "-I"; "+lablgtk2"] else []))
(* Transform bytecode object file names in native object file names *)
let native_suffix f =
- if Filename.check_suffix f ".cmo" then
+ if Filename.check_suffix f ".cmo" then
(Filename.chop_suffix f ".cmo") ^ ".cmx"
- else if Filename.check_suffix f ".cma" then
+ else if Filename.check_suffix f ".cma" then
(Filename.chop_suffix f ".cma") ^ ".cmxa"
- else
- if Filename.check_suffix f ".a" then f
+ else
+ if Filename.check_suffix f ".a" then f
else
failwith ("File "^f^" has not extension .cmo, .cma or .a")
@@ -112,8 +112,8 @@ let all_subdirs dir =
let l = ref [dir] in
let add f = l := f :: !l in
let rec traverse dir =
- let dirh =
- try opendir dir with Unix_error _ -> invalid_arg "all_subdirs"
+ let dirh =
+ try opendir dir with Unix_error _ -> invalid_arg "all_subdirs"
in
try
while true do
@@ -152,13 +152,13 @@ Flags are:
let parse_args () =
let rec parse (op,fl) = function
| [] -> List.rev op, List.rev fl
- | "-coqlib" :: d :: rem ->
+ | "-coqlib" :: d :: rem ->
Flags.coqlib_spec := true; Flags.coqlib := d ; parse (op,fl) rem
| "-coqlib" :: _ -> usage ()
- | "-camlbin" :: d :: rem ->
+ | "-camlbin" :: d :: rem ->
Flags.camlbin_spec := true; Flags.camlbin := d ; parse (op,fl) rem
| "-camlbin" :: _ -> usage ()
- | "-camlp4bin" :: d :: rem ->
+ | "-camlp4bin" :: d :: rem ->
Flags.camlp4bin_spec := true; Flags.camlp4bin := d ; parse (op,fl) rem
| "-camlp4bin" :: _ -> usage ()
| "-boot" :: rem -> Flags.boot := true; parse (op,fl) rem
@@ -167,7 +167,7 @@ let parse_args () =
| "-top" :: rem -> top := true ; parse (op,fl) rem
| "-ide" :: rem ->
coqide := true; parse (op,fl) rem
- | "-v8" :: rem ->
+ | "-v8" :: rem ->
Printf.eprintf "warning: option -v8 deprecated";
parse (op,fl) rem
| "-echo" :: rem -> echo := true ; parse (op,fl) rem
@@ -185,8 +185,8 @@ let parse_args () =
parse (o::op,fl) rem
| ("-h"|"--help") :: _ -> usage ()
| f :: rem ->
- if Filename.check_suffix f ".ml"
- or Filename.check_suffix f ".cmx"
+ if Filename.check_suffix f ".ml"
+ or Filename.check_suffix f ".cmx"
or Filename.check_suffix f ".cmo"
or Filename.check_suffix f ".cmxa"
or Filename.check_suffix f ".cma" then
@@ -243,14 +243,14 @@ let create_tmp_main_file modules =
let main_name = Filename.temp_file "coqmain" ".ml" in
let oc = open_out main_name in
try
- (* Add the pre-linked modules *)
+ (* Add the pre-linked modules *)
output_string oc "List.iter Mltop.add_known_module [\"";
output_string oc (String.concat "\";\"" modules);
output_string oc "\"];;\n";
(* Initializes the kind of loading *)
output_string oc (declare_loading_string());
(* Start the right toplevel loop: Coq or Coq_searchisos *)
- if !searchisos then
+ if !searchisos then
output_string oc "Cmd_searchisos_line.start();;\n"
else if !coqide then
output_string oc "Coqide.start();;\n"
@@ -258,7 +258,7 @@ let create_tmp_main_file modules =
output_string oc "Coqtop.start();;\n";
close_out oc;
main_name
- with e ->
+ with e ->
clean main_name; raise e
(* main part *)
@@ -298,19 +298,19 @@ let main () =
let args = if !top then args @ [ "topstart.cmo" ] else args in
(* Now, with the .cma, we MUST use the -linkall option *)
let command = String.concat " " (prog::"-rectypes"::args) in
- if !echo then
- begin
- print_endline command;
- print_endline
- ("(command length is " ^
+ if !echo then
+ begin
+ print_endline command;
+ print_endline
+ ("(command length is " ^
(string_of_int (String.length command)) ^ " characters)");
- flush Pervasives.stdout
+ flush Pervasives.stdout
end;
let retcode = Sys.command command in
clean main_file;
(* command gives the exit code in HSB, and signal in LSB !!! *)
- if retcode > 255 then retcode lsr 8 else retcode
- with e ->
+ if retcode > 255 then retcode lsr 8 else retcode
+ with e ->
clean main_file; raise e
let retcode =