Commit 5f9c7c7d authored by MARCHE Claude's avatar MARCHE Claude
Browse files

Catch errors when opening source files in IDE

parent ebaec40b
...@@ -150,12 +150,15 @@ let try_convert s = ...@@ -150,12 +150,15 @@ let try_convert s =
with Glib.Convert.Error _ as e -> Printexc.to_string e with Glib.Convert.Error _ as e -> Printexc.to_string e
let source_text fname = let source_text fname =
let ic = open_in fname in try
let size = in_channel_length ic in let ic = open_in fname in
let buf = String.create size in let size = in_channel_length ic in
really_input ic buf 0 size; let buf = String.create size in
close_in ic; really_input ic buf 0 size;
try_convert buf close_in ic;
try_convert buf
with e when not (Debug.test_flag Debug.stack_trace) ->
"Error while opening or reading file '" ^ fname ^ "':\n" ^ (Printexc.to_string e)
(********************************) (********************************)
(* loading WhyIDE configuration *) (* loading WhyIDE configuration *)
......
...@@ -17,7 +17,6 @@ open Ident ...@@ -17,7 +17,6 @@ open Ident
open Ty open Ty
open Term open Term
open Decl open Decl
open Theory
open Printer open Printer
let ident_printer = let ident_printer =
......
...@@ -17,7 +17,6 @@ open Ident ...@@ -17,7 +17,6 @@ open Ident
open Ty open Ty
open Term open Term
open Decl open Decl
open Theory
open Printer open Printer
(** SMTLIB tokens taken from CVC4: src/parser/smt2/Smt2.g *) (** SMTLIB tokens taken from CVC4: src/parser/smt2/Smt2.g *)
......
...@@ -17,7 +17,6 @@ open Ident ...@@ -17,7 +17,6 @@ open Ident
open Ty open Ty
open Term open Term
open Decl open Decl
open Theory
open Printer open Printer
let ident_printer = let ident_printer =
......
...@@ -2103,7 +2103,7 @@ let rec recompute_all_shapes_goal ~release g = ...@@ -2103,7 +2103,7 @@ let rec recompute_all_shapes_goal ~release g =
g.goal_checksum <- Termcode.task_checksum t; g.goal_checksum <- Termcode.task_checksum t;
if release then release_task g; if release then release_task g;
iter_goal iter_goal
(fun pa -> ()) (fun _pa -> ())
(iter_transf (recompute_all_shapes_goal ~release)) (iter_transf (recompute_all_shapes_goal ~release))
(iter_metas (recompute_all_shapes_goal ~release)) (iter_metas (recompute_all_shapes_goal ~release))
g g
......
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