method virtual evalTactical:
(CicAst.term, string) TacticAst.tactical -> state_tag
-(*
- method undo ?(steps = 1) () =
- for i = 1 to steps do
- match List.hd !history with
- | `Qed
- FINQUI
-*)
-
method evalPhrase s =
debug_print (sprintf "evaluating '%s'" s);
self#evalTactical (self#parsePhrase s)
+ method evalAst ast = self#evalTactical ast
+
method endOffset =
match !loc with
| Some (start_pos, end_pos) -> end_pos.Lexing.pos_cnum
new commandState ~disambiguator ~proof_handler ~console ()
in
let proofState = new proofState ~disambiguator ~proof_handler ~console () in
+ let wrap_exn transparent f =
+ try
+ f ();
+ true
+ with exn ->
+ if transparent then
+ raise exn
+ else
+ console#echo_error (sprintf "Uncaught exception: %s"
+ (Printexc.to_string exn));
+ false
+ in
object (self)
val mutable state = commandState
| None -> ()
method evalPhrase ?(transparent = false) s =
- try
- self#updateState (state#evalPhrase s)
- with exn ->
- if transparent then
- raise exn
- else
- console#echo_error (sprintf "Uncaught exception: %s"
- (Printexc.to_string exn))
+ wrap_exn transparent (fun () -> self#updateState (state#evalPhrase s))
+
+ method evalAst ?(transparent = false) s =
+ wrap_exn transparent (fun () -> self#updateState (state#evalAst s))
end