aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaƫtan Gilbert2019-05-21 13:52:52 +0200
committerEnrico Tassi2019-06-04 13:58:43 +0200
commit80602ad2acb5f497594b2e76b03b73a080847a07 (patch)
treed6f091e34e0e7a8c7e14d282b571b5f7808f4faf
parent99154fcb97653c606d2e62e0a0521c4afddff44c (diff)
Replace ModifyProofStack by CloseProof
The only use of ModifyProofStack was in paramcoq for closing a proof.
-rw-r--r--coqpp/coqpp_main.ml2
-rw-r--r--vernac/vernacentries.ml7
-rw-r--r--vernac/vernacentries.mli2
3 files changed, 7 insertions, 4 deletions
diff --git a/coqpp/coqpp_main.ml b/coqpp/coqpp_main.ml
index b118d9ec00..48f9ed30b0 100644
--- a/coqpp/coqpp_main.ml
+++ b/coqpp/coqpp_main.ml
@@ -358,7 +358,7 @@ let print_atts_right fmt = function
fprintf fmt "(Attributes.parse %s%a atts)" nota aux atts
let understand_state = function
- | "proof_stack" -> "VtModifyProofStack", false
+ | "close_proof" -> "VtCloseProof", false
| "maybe_open_proof" -> "VtMaybeOpenProof", true
| "open_proof" -> "VtOpenProof", true
| "proof" -> "VtModifyProof", false
diff --git a/vernac/vernacentries.ml b/vernac/vernacentries.ml
index c88de1181a..77e8a92cc1 100644
--- a/vernac/vernacentries.ml
+++ b/vernac/vernacentries.ml
@@ -2714,7 +2714,7 @@ let interp ?(verbosely=true) ?proof ~st cmd =
type functional_vernac =
| VtDefault of (unit -> unit)
- | VtModifyProofStack of (pstate:Proof_global.stack option -> Proof_global.stack option)
+ | VtCloseProof of (pstate:Proof_global.t -> unit)
| VtMaybeOpenProof of (unit -> Proof_global.t option)
| VtOpenProof of (unit -> Proof_global.t)
| VtModifyProof of (pstate:Proof_global.t -> Proof_global.t)
@@ -2725,7 +2725,10 @@ let interp_functional_vernac c ~pstate =
let open Proof_global in
match c with
| VtDefault f -> f (); pstate
- | VtModifyProofStack f -> f ~pstate
+ | VtCloseProof f ->
+ vernac_require_open_proof ~pstate (fun ~pstate ->
+ f ~pstate:(Proof_global.get_current_pstate pstate);
+ Proof_global.discard_current pstate)
| VtMaybeOpenProof f ->
let proof = f () in
let pstate = maybe_push ~ontop:pstate proof in
diff --git a/vernac/vernacentries.mli b/vernac/vernacentries.mli
index 06a08e5e6b..ca3a962319 100644
--- a/vernac/vernacentries.mli
+++ b/vernac/vernacentries.mli
@@ -56,7 +56,7 @@ val test_mode : bool ref
type functional_vernac =
| VtDefault of (unit -> unit)
- | VtModifyProofStack of (pstate:Proof_global.stack option -> Proof_global.stack option)
+ | VtCloseProof of (pstate:Proof_global.t -> unit)
| VtMaybeOpenProof of (unit -> Proof_global.t option)
| VtOpenProof of (unit -> Proof_global.t)
| VtModifyProof of (pstate:Proof_global.t -> Proof_global.t)