(************************************************************************) (* v * The Coq Proof Assistant / The Coq Development Team *) (* unit; raw_interp : string -> unit; read_stdout : unit -> string; rewind : int -> unit; is_in_loadpath : string -> bool; 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) (** * Debug printing *) let pr_call = function | In_loadpath s -> "In_loadpath["^s^"]" | Raw_interp s -> "Raw_interp["^s^"]" | Interp (b,s) -> "Interp["^(if b then "true" else "false")^","^s^"]" | Rewind i -> "Rewind["^(string_of_int i)^"]" | Read_stdout -> "Read_stdout" | Cur_goals -> "Cur_goals" | Cur_status -> "Cur_status" | Cases s -> "Cases["^s^"]" let pr_value = function | Good _ -> "Good" | Fail (_,str) -> "Fail["^str^"]"