diff options
| author | Emilio Jesus Gallego Arias | 2018-10-13 21:19:34 +0200 |
|---|---|---|
| committer | Emilio Jesus Gallego Arias | 2018-11-28 02:00:53 +0100 |
| commit | df85d9b765940b58a189b91cfdc67be7e0fd75e3 (patch) | |
| tree | 297517301041274f5546b5f62f7181c3cf70f2fc /stm | |
| parent | ec7aec452da1ad0bf53145a314df7c00194218a6 (diff) | |
[options] New helper for creation of boolean options plus reference.
This makes setting the option outside of the synchronized summary impossible.
Diffstat (limited to 'stm')
| -rw-r--r-- | stm/stm.ml | 15 |
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)) |
