From ed18f926e4695acc730218925ca156abe56ba5fc Mon Sep 17 00:00:00 2001 From: Emilio Jesus Gallego Arias Date: Tue, 13 Feb 2018 18:26:00 +0100 Subject: [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. --- proofs/proof_global.ml | 1 + proofs/proof_global.mli | 1 + 2 files changed, 2 insertions(+) (limited to 'proofs') 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. *) -- cgit v1.2.3