diff options
-rw-r--r-- | library/global.ml | 2 | ||||
-rw-r--r-- | library/global.mli | 2 | ||||
-rw-r--r-- | toplevel/coqtop.ml | 14 |
3 files changed, 17 insertions, 1 deletions
diff --git a/library/global.ml b/library/global.ml index 8b61c9a4a..c2c42159b 100644 --- a/library/global.ml +++ b/library/global.ml @@ -68,7 +68,7 @@ let add_module = add_thing (fun _ -> add_module) () let add_constraints c = global_env := add_constraints c !global_env - +let set_engagement c = global_env := set_engagement c !global_env let start_module id params mtyo = let l = label_of_id id in diff --git a/library/global.mli b/library/global.mli index 72d3731df..cd7a90e18 100644 --- a/library/global.mli +++ b/library/global.mli @@ -49,6 +49,8 @@ val add_modtype : identifier -> module_type_entry -> kernel_name val add_constraints : constraints -> unit +val set_engagement : Environ.engagement -> unit + (*s Interactive modules and module types *) (* Both [start_*] functions take the [dir_path] argument to create a [mod_self_id]. This should be the name of the compilation unit. *) diff --git a/toplevel/coqtop.ml b/toplevel/coqtop.ml index 85a289ff3..a7ff15cee 100644 --- a/toplevel/coqtop.ml +++ b/toplevel/coqtop.ml @@ -34,6 +34,14 @@ let print_memory_stat () = let _ = at_exit print_memory_stat +let engagement = ref None +let set_engagement c = + if !engagement <> None then error + "Options strongly-constructive/strongly-classical occur more than once"; + engagement := Some c +let engage () = + match !engagement with Some c -> Global.set_engagement c | None -> () + let set_batch_mode () = batch_mode := true let remove_top_ml () = Mltop.remove () @@ -142,6 +150,11 @@ let parse_args is_ide = let rec parse = function | [] -> () + | "-strongly-constructive" :: rem -> + set_engagement Environ.StronglyConstructive; parse rem + | "-strongly-classical" :: rem -> + set_engagement Environ.StronglyClassical; parse rem + | ("-I"|"-include") :: d :: rem -> set_default_include d; parse rem | ("-I"|"-include") :: [] -> usage () @@ -265,6 +278,7 @@ let init is_ide = if_verbose print_header (); init_load_path (); inputstate (); + engage (); init_library_roots (); load_vernac_obj (); require (); |