aboutsummaryrefslogtreecommitdiff
path: root/stm
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2018-11-28 08:47:40 +0100
committerPierre-Marie Pédrot2018-11-28 08:47:40 +0100
commitb106042cc1d752e69c0f3d218d794a79f27853cc (patch)
tree60b77d18c9abd10d2439eb0b5ce7ab7a2d02796a /stm
parent7db1dbb91439eecad777064fcbb8a8e904fc690d (diff)
parentdf85d9b765940b58a189b91cfdc67be7e0fd75e3 (diff)
Merge PR #8727: [options] New helper for creation of boolean options plus reference.
Diffstat (limited to 'stm')
-rw-r--r--stm/stm.ml15
1 files changed, 7 insertions, 8 deletions
diff --git a/stm/stm.ml b/stm/stm.ml
index c078dbae56..94405924b7 100644
--- a/stm/stm.ml
+++ b/stm/stm.ml
@@ -2838,13 +2838,12 @@ let process_back_meta_command ~newtip ~head oid aast w =
VCS.commit id (Alias (oid,aast));
Backtrack.record (); if w == VtNow then ignore(finish ~doc:dummy_doc); `Ok
-let allow_nested_proofs = ref false
-let () = Goptions.(declare_bool_option
- { optdepr = false;
- optname = "Nested Proofs Allowed";
- optkey = Vernac_classifier.stm_allow_nested_proofs_option_name;
- optread = (fun () -> !allow_nested_proofs);
- optwrite = (fun b -> allow_nested_proofs := b) })
+let get_allow_nested_proofs =
+ Goptions.declare_bool_option_and_ref
+ ~depr:false
+ ~name:"Nested Proofs Allowed"
+ ~key:Vernac_classifier.stm_allow_nested_proofs_option_name
+ ~value:false
let process_transaction ~doc ?(newtip=Stateid.fresh ())
({ verbose; loc; expr } as x) c =
@@ -2877,7 +2876,7 @@ let process_transaction ~doc ?(newtip=Stateid.fresh ())
(* Proof *)
| VtStartProof (mode, guarantee, names), w ->
- if not !allow_nested_proofs && VCS.proof_nesting () > 0 then
+ if not (get_allow_nested_proofs ()) && VCS.proof_nesting () > 0 then
"Nested proofs are not allowed unless you turn option Nested Proofs Allowed on."
|> Pp.str
|> (fun s -> (UserError (None, s), Exninfo.null))