(************************************************************************) (* * The Rocq Prover / The Rocq Development Team *) (* v * Copyright INRIA, CNRS and contributors *) (* true) f x let without_option o f x = with_modified_ref ~restore:false o (fun _ -> false) f x (* hide the [restore] option as internal *) let with_modified_ref r nf f x = with_modified_ref r nf f x let with_options ol f x = let vl = List.map (!) ol in let () = List.iter (fun r -> r := true) ol in try let r = f x in let () = List.iter2 (:=) ol vl in r with reraise -> let reraise = Exninfo.capture reraise in let () = List.iter2 (:=) ol vl in Exninfo.iraise reraise let async_proofs_worker_id = ref "master" let async_proofs_is_worker () = !async_proofs_worker_id <> "master" let in_debugger = ref false let in_ml_toplevel = ref false let in_synterp_phase = ref None (* Silent / Verbose *) let quiet = ref false let silently f x = with_option quiet f x let verbosely f x = without_option quiet f x let if_silent f x = if !quiet then f x let if_verbose f x = if not !quiet then f x let test_mode = ref false