Commit 56754c0c authored by François Bobot's avatar François Bobot

[Ide] print parsing/typing errors for the files given on the command line on stderr and exit

parent 084aef32
...@@ -866,7 +866,7 @@ let sched = ...@@ -866,7 +866,7 @@ let sched =
(* add new file from command line *) (* add new file from command line *)
(**********************************) (**********************************)
let open_file f = let open_file ?(start=false) f =
let f = Sysutil.relativize_filename project_dir f in let f = Sysutil.relativize_filename project_dir f in
Debug.dprintf debug "Adding file '%s'@." f; Debug.dprintf debug "Adding file '%s'@." f;
if S.PHstr.mem (env_session()).S.session.S.session_files f then if S.PHstr.mem (env_session()).S.session.S.session_files f then
...@@ -876,12 +876,19 @@ let open_file f = ...@@ -876,12 +876,19 @@ let open_file f =
Debug.dprintf debug "[Info] adding file %s in database@." f; Debug.dprintf debug "[Info] adding file %s in database@." f;
ignore (M.add_file (env_session()) ?format:!opt_parser f); ignore (M.add_file (env_session()) ?format:!opt_parser f);
with e -> with e ->
let msg = if start
Pp.sprintf_wnl "@[Error while reading file@ '%s':@ %a@]" f then begin
Exn_printer.exn_printer e in eprintf "@[Error while reading file@ '%s':@ %a@]@." f
info_window `ERROR msg Exn_printer.exn_printer e;
exit 1
end
else
let msg =
Pp.sprintf_wnl "@[Error while reading file@ '%s':@ %a@]" f
Exn_printer.exn_printer e in
info_window `ERROR msg
let () = Queue.iter open_file files let () = Queue.iter (open_file ~start:true) files
(*****************************************************) (*****************************************************)
(* method: run a given prover on each unproved goals *) (* method: run a given prover on each unproved goals *)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment