aboutsummaryrefslogtreecommitdiff
path: root/vernac/attributes.ml
diff options
context:
space:
mode:
authorGaëtan Gilbert2018-10-11 19:08:33 +0200
committerGaëtan Gilbert2018-11-02 13:26:16 +0100
commitc44080b74f4ea1e4b7ae88dfe5a440364bed3fca (patch)
treea14664e5bb5165415d2b1928fc0f2896e6ec36c1 /vernac/attributes.ml
parent1808904b3088595f89c24aa25bffcc54b2b48fda (diff)
Universe Polymorphism is a normal attribute modulo the stm (no Flags)
Diffstat (limited to 'vernac/attributes.ml')
-rw-r--r--vernac/attributes.ml24
1 files changed, 18 insertions, 6 deletions
diff --git a/vernac/attributes.ml b/vernac/attributes.ml
index 14db90c3de..88638b295b 100644
--- a/vernac/attributes.ml
+++ b/vernac/attributes.ml
@@ -126,8 +126,6 @@ let qualify_attribute qual (parser:'a attribute) : 'a attribute =
let extra = if rem = [] then extra else (qual, VernacFlagList rem) :: extra in
extra, v
-let polymorphic_base = bool_attribute ~name:"Polymorphism" ~on:"polymorphic" ~off:"monomorphic"
-
let program_opt = bool_attribute ~name:"Program mode" ~on:"program" ~off:"noprogram"
let program = program_opt >>= function
@@ -154,14 +152,28 @@ let universe_transform ~warn_unqualified : unit attribute =
in
atts, ()
+let universe_polymorphism_option_name = ["Universe"; "Polymorphism"]
+let is_universe_polymorphism =
+ let b = ref false in
+ let _ = let open Goptions in
+ declare_bool_option
+ { optdepr = false;
+ optname = "universe polymorphism";
+ optkey = universe_polymorphism_option_name;
+ optread = (fun () -> !b);
+ optwrite = ((:=) b) }
+ in
+ fun () -> !b
+
+let polymorphic_base =
+ bool_attribute ~name:"Polymorphism" ~on:"polymorphic" ~off:"monomorphic" >>= function
+ | Some b -> return b
+ | None -> return (is_universe_polymorphism())
+
let polymorphic_nowarn =
universe_transform ~warn_unqualified:false >>
qualify_attribute ukey polymorphic_base
-let polymorphic_base = polymorphic_base >>= function
- | Some b -> return b
- | None -> return (Flags.is_universe_polymorphism())
-
let universe_poly_template =
let template = bool_attribute ~name:"Template" ~on:"template" ~off:"notemplate" in
universe_transform ~warn_unqualified:true >>