diff options
author | Emilio Jesus Gallego Arias <e+git@x80.org> | 2018-02-13 18:26:00 +0100 |
---|---|---|
committer | Emilio Jesus Gallego Arias <e+git@x80.org> | 2018-02-15 11:37:51 +0100 |
commit | ed18f926e4695acc730218925ca156abe56ba5fc (patch) | |
tree | 390d1fef8613afbfe4c5e2de3209e06f48f59122 /proofs | |
parent | 4bc9529ece085441121678a07e4b269c7633471c (diff) |
[toplevel] Make toplevel state into a record.
We organize the toplevel execution as a record and pass it
around. This will be used by future PRs as to for example decouple
goal printing from the classifier.
Diffstat (limited to 'proofs')
-rw-r--r-- | proofs/proof_global.ml | 1 | ||||
-rw-r--r-- | proofs/proof_global.mli | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/proofs/proof_global.ml b/proofs/proof_global.ml index fc94a1013..833e34c33 100644 --- a/proofs/proof_global.ml +++ b/proofs/proof_global.ml @@ -146,6 +146,7 @@ let cur_pstate () = | [] -> raise NoCurrentProof let give_me_the_proof () = (cur_pstate ()).proof +let give_me_the_proof_opt () = try Some (give_me_the_proof ()) with | NoCurrentProof -> None let get_current_proof_name () = (cur_pstate ()).pid let with_current_proof f = diff --git a/proofs/proof_global.mli b/proofs/proof_global.mli index 27e99f218..29445a746 100644 --- a/proofs/proof_global.mli +++ b/proofs/proof_global.mli @@ -24,6 +24,7 @@ val discard : Names.Id.t Loc.located -> unit val discard_current : unit -> unit val discard_all : unit -> unit +val give_me_the_proof_opt : unit -> Proof.t option exception NoCurrentProof val give_me_the_proof : unit -> Proof.t (** @raise NoCurrentProof when outside proof mode. *) |