* second component represents console action: true = hide, false = keep *)
type command_outcome = bool * bool
+ (** schematic representation of items scripts are made of *)
+type script_item =
+ [ `Tactic (** action on proof status *)
+ | `Theorem (** start of proof, to be proved *)
+ | `Qed of UriManager.uri (** end of proof, successfull *)
+ | `Def of UriManager.uri (** constant with body *)
+ | `Inductive of UriManager.uri (** inductive definition *)
+ ]
+
(** interpreter for toplevel phrases given via console *)
class type interpreter =
object
- method reset: unit (** return the interpreter to the initial state *)
-
(** parse a single phrase contained in the input string. Additional
* garbage at the end of the phrase is ignored
* @return true if no exception has been raised by the evaluation, false
(** as above, evaluating a command/tactics AST *)
method evalAst: DisambiguateTypes.tactical -> command_outcome
+ (** {3 callbacks} *)
+
+ method setEvalAstCallback: (DisambiguateTypes.tactical -> unit) -> unit
+
+ (** {3 stateful methods}
+ * bookkeeping of last interpreted phrase *)
+
(** offset from the starting of the last string parser by evalPhrase where
* parsing stop.
* @raise Failure when no offset has been recorded *)
method endOffset: int
+ (** last item parsed *)
+ method lastItem: script_item option
+
+ (** change internal interpreter state *)
+ method setState: [`Proof | `Command] -> unit
+
end
(** {2 MathML widgets} *)