diff options
Diffstat (limited to 'driver')
-rw-r--r-- | driver/main.ml | 20 | ||||
-rw-r--r-- | driver/main_args.ml | 8 | ||||
-rw-r--r-- | driver/main_args.mli | 2 |
3 files changed, 21 insertions, 9 deletions
diff --git a/driver/main.ml b/driver/main.ml index e3dea594e..5c47a74dd 100644 --- a/driver/main.ml +++ b/driver/main.ml @@ -75,10 +75,12 @@ let print_standard_library () = let usage = "Usage: ocamlc <options> <files>\nOptions are:" +let ppf = Format.err_formatter + (* Error messages to standard error formatter *) -let anonymous = process_file Format.err_formatter;; -let impl = process_implementation_file Format.err_formatter;; -let intf = process_interface_file Format.err_formatter;; +let anonymous = process_file ppf;; +let impl = process_implementation_file ppf;; +let intf = process_interface_file ppf;; let show_config () = Config.print_config stdout; @@ -170,14 +172,14 @@ let main () = if !make_archive then begin Compile.init_path(); - Bytelibrarian.create_archive (List.rev !objfiles) + Bytelibrarian.create_archive ppf (List.rev !objfiles) (extract_output !output_name) end else if !make_package then begin Compile.init_path(); - let exctracted_output = extract_output !output_name in - let revd = List.rev !objfiles in - Bytepackager.package_files (revd) + let exctracted_output = extract_output !output_name in + let revd = List.rev !objfiles in + Bytepackager.package_files ppf (revd) (exctracted_output) end else if not !compile_only && !objfiles <> [] then begin @@ -198,11 +200,11 @@ let main () = default_output !output_name in Compile.init_path(); - Bytelink.link (List.rev !objfiles) target + Bytelink.link ppf (List.rev !objfiles) target end; exit 0 with x -> - Errors.report_error Format.err_formatter x; + Errors.report_error ppf x; exit 2 let _ = main () diff --git a/driver/main_args.ml b/driver/main_args.ml index 326c63e82..968fe82af 100644 --- a/driver/main_args.ml +++ b/driver/main_args.ml @@ -217,6 +217,10 @@ let mk_S f = "-S", Arg.Unit f, " Keep intermediate assembly file" ;; +let mk_stdin f = + "-stdin", Arg.Unit f, " Read script from standard input" +;; + let mk_strict_sequence f = "-strict-sequence", Arg.Unit f, " Left-hand part of a sequence must have type unit" @@ -449,6 +453,7 @@ module type Bytetop_options = sig val _nostdlib : unit -> unit val _principal : unit -> unit val _rectypes : unit -> unit + val _stdin: unit -> unit val _strict_sequence : unit -> unit val _unsafe : unit -> unit val _version : unit -> unit @@ -549,6 +554,7 @@ module type Opttop_options = sig val _principal : unit -> unit val _rectypes : unit -> unit val _S : unit -> unit + val _stdin : unit -> unit val _strict_sequence : unit -> unit val _unsafe : unit -> unit val _version : unit -> unit @@ -661,6 +667,7 @@ struct mk_nostdlib F._nostdlib; mk_principal F._principal; mk_rectypes F._rectypes; + mk_stdin F._stdin; mk_strict_sequence F._strict_sequence; mk_unsafe F._unsafe; mk_version F._version; @@ -766,6 +773,7 @@ module Make_opttop_options (F : Opttop_options) = struct mk_principal F._principal; mk_rectypes F._rectypes; mk_S F._S; + mk_stdin F._stdin; mk_strict_sequence F._strict_sequence; mk_unsafe F._unsafe; mk_version F._version; diff --git a/driver/main_args.mli b/driver/main_args.mli index ff284a985..2249ab20c 100644 --- a/driver/main_args.mli +++ b/driver/main_args.mli @@ -83,6 +83,7 @@ module type Bytetop_options = sig val _nostdlib : unit -> unit val _principal : unit -> unit val _rectypes : unit -> unit + val _stdin : unit -> unit val _strict_sequence : unit -> unit val _unsafe : unit -> unit val _version : unit -> unit @@ -183,6 +184,7 @@ module type Opttop_options = sig val _principal : unit -> unit val _rectypes : unit -> unit val _S : unit -> unit + val _stdin : unit -> unit val _strict_sequence : unit -> unit val _unsafe : unit -> unit val _version : unit -> unit |