From a9f2ba45c7dba54bfd44078587fc6176a5af68d6 Mon Sep 17 00:00:00 2001 From: Gaƫtan Gilbert Date: Wed, 19 Sep 2018 14:33:44 +0200 Subject: Remove pointless optional arguments to mk_atts --- vernac/attributes.ml | 12 ++++++++++-- vernac/attributes.mli | 6 +++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/vernac/attributes.ml b/vernac/attributes.ml index ce77256edd..c93ff2a63a 100644 --- a/vernac/attributes.ml +++ b/vernac/attributes.ml @@ -24,8 +24,16 @@ type t = { deprecated : deprecation option; } -let mk_atts ?(locality=None) ?(polymorphic=false) ?(template=None) ?(program=false) ?(deprecated=None) () = - { locality ; polymorphic ; program ; deprecated; template } +let default = { + locality = None; + polymorphic = false; + template = None; + program = false; + deprecated = None; +} + +let mk_atts ?(polymorphic=default.polymorphic) ?(program=default.program) () = + { default with polymorphic; program } let attributes_of_flags f atts = let assert_empty k v = diff --git a/vernac/attributes.mli b/vernac/attributes.mli index 7fe71bb048..b9191c3f3e 100644 --- a/vernac/attributes.mli +++ b/vernac/attributes.mli @@ -20,9 +20,9 @@ type t = { deprecated : deprecation option; } -val mk_atts : ?locality: bool option -> - ?polymorphic: bool -> ?template:bool option -> - ?program: bool -> ?deprecated: deprecation option -> unit -> t +val mk_atts : + ?polymorphic: bool -> + ?program: bool -> unit -> t val attributes_of_flags : Vernacexpr.vernac_flags -> t -> bool option (* polymorphism attr *) * t -- cgit v1.2.3