summaryrefslogtreecommitdiff
path: root/driver/compile.ml
diff options
context:
space:
mode:
authorDamien Doligez <damien.doligez-inria.fr>2007-12-04 13:38:58 +0000
committerDamien Doligez <damien.doligez-inria.fr>2007-12-04 13:38:58 +0000
commite9a9bf961371899ed6d2bb02be98ab98c6adb5f6 (patch)
tree91cd210ff2fd64cced560d5a63f3fbe3317f1e73 /driver/compile.ml
parent0593f338d4f9bb9942b6bc69e6786dba45f5d610 (diff)
downloadocaml-e9a9bf961371899ed6d2bb02be98ab98c6adb5f6.tar.gz
PR#3114 make all error messages start with a location and "Error: "
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@8705 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'driver/compile.ml')
-rw-r--r--driver/compile.ml5
1 files changed, 4 insertions, 1 deletions
diff --git a/driver/compile.ml b/driver/compile.ml
index a847dcab4a..3cf2c749e6 100644
--- a/driver/compile.ml
+++ b/driver/compile.ml
@@ -51,6 +51,7 @@ let initial_env () =
(* Compile a .mli file *)
let interface ppf sourcefile outputprefix =
+ Location.input_name := sourcefile;
init_path ();
let modulename =
String.capitalize(Filename.basename(chop_extension_if_any sourcefile)) in
@@ -81,6 +82,7 @@ let print_if ppf flag printer arg =
let (++) x f = f x
let implementation ppf sourcefile outputprefix =
+ Location.input_name := sourcefile;
init_path ();
let modulename =
String.capitalize(Filename.basename(chop_extension_if_any sourcefile)) in
@@ -95,7 +97,7 @@ let implementation ppf sourcefile outputprefix =
with x ->
Pparse.remove_preprocessed_if_ast inputfile;
raise x
- end else begin
+ end else begin
let objfile = outputprefix ^ ".cmo" in
let oc = open_out_bin objfile in
try
@@ -123,4 +125,5 @@ let implementation ppf sourcefile outputprefix =
end
let c_file name =
+ Location.input_name := name;
if Ccomp.compile_file name <> 0 then exit 2