From e84e0f9e4eb6263e870deb1e00929170bc0301ea Mon Sep 17 00:00:00 2001 From: letouzey Date: Wed, 23 Mar 2011 17:18:57 +0000 Subject: Ide: stronger separation from coqtop Former module Ide_blob is now divided in Ide_intf (linked both by coqtop and coqide) and Ide_slave (now only in coqtop). Ide_intf has almost no dependencies, we can now compile coqide with only coq_config.cm* and lib.cm(x)a TODO: - Devise a better way to display whether coqide is byte or opt in the about message (instead of Mltop.is_native, I display now the executable name, which hopefully contains opt or byte) - Check the late error handling in ide/coq.ml git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@13927 85f007b7-540e-0410-9357-904b9bb8a0f7 --- toplevel/ide_intf.ml | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 toplevel/ide_intf.ml (limited to 'toplevel/ide_intf.ml') diff --git a/toplevel/ide_intf.ml b/toplevel/ide_intf.ml new file mode 100644 index 0000000000..fb8c9e94d3 --- /dev/null +++ b/toplevel/ide_intf.ml @@ -0,0 +1,84 @@ +(************************************************************************) +(* v * The Coq Proof Assistant / The Coq Development Team *) +(* bool; + raw_interp : string -> unit; + interp : bool -> string -> int; + rewind : int -> int; + read_stdout : unit -> string; + current_goals : unit -> goals; + current_status : unit -> string; + make_cases : string -> string list list; +} + +let abstract_eval_call handler explain_exn c = + try + let res = match c with + | In_loadpath s -> Obj.magic (handler.is_in_loadpath s) + | Raw_interp s -> Obj.magic (handler.raw_interp s) + | Interp (b,s) -> Obj.magic (handler.interp b s) + | Rewind i -> Obj.magic (handler.rewind i) + | Read_stdout -> Obj.magic (handler.read_stdout ()) + | Cur_goals -> Obj.magic (handler.current_goals ()) + | Cur_status -> Obj.magic (handler.current_status ()) + | Cases s -> Obj.magic (handler.make_cases s) + in Good res + with e -> + let (l,str) = explain_exn e in + Fail (l,str) -- cgit v1.2.3