AttributesThe type of parsing attribute data
type vernac_flags = vernac_flag listand vernac_flag = (string * vernac_flag_value) CAst.tand vernac_flag_value = | VernacFlagEmpty |
| VernacFlagLeaf of vernac_flag_type |
| VernacFlagList of vernac_flags |
val pr_vernac_flag : vernac_flag -> Pp.tThe type of attributes. When parsing attributes if an 'a
attribute is present then an 'a value will be produced. In the most general case, an attribute transforms the raw flags along with its value.
val parse : 'a attribute -> vernac_flags -> 'aErrors on unsupported attributes.
val unsupported_attributes : vernac_flags -> unitErrors if the list of flags is nonempty.
module Notations : sig ... endNotations to combine attributes.
Definitions for some standard attributes.
val raw_attributes : vernac_flags attributeval polymorphic : bool attributeval program : bool attributeval template : bool option attributeval unfold_fix : bool attributeval locality : bool option attributeval option_locality : Goptions.option_locality attributeval reversible : bool option attributeval canonical_field : bool attributeval canonical_instance : bool attributeval using : string option attributeval explicit_hint_locality : Hints.hint_locality option attributeval bind_scope_where : Notation.add_scope_where option attributeval deprecation : Deprecation.t option attribute"deprecated"
val deprecation_with_use_globref_instead : Globnames.extended_global_reference Deprecation.with_qf option attributeval user_warn_warn : UserWarn.warn list attributeJust the "warn" attribute
val user_warns : UserWarn.t option attribute"warn" and "deprecated"
val user_warns_with_use_globref_instead : Globnames.extended_global_reference UserWarn.with_qf option attributeval hint_locality : Hints.hint_locality attributeDefault: if sections are opened then Local otherwise Export. Although this is named and uses the type hint_locality it may be used as the standard 3-valued locality attribute.
val hint_locality_default_superglobal : Hints.hint_locality attributeLike hint_locality but the default in and out of sections is SuperGlobal.
val typing_flags : Declarations.typing_flags option attributeEnable/Disable universe checking
val only_locality : vernac_flags -> bool optionParse attributes allowing only locality.
val only_polymorphism : vernac_flags -> boolParse attributes allowing only polymorphism. Uses the global flag for the default value.
val parse_drop_extra : 'a attribute -> vernac_flags -> 'aIgnores unsupported attributes.
val parse_with_extra : 'a attribute -> vernac_flags -> vernac_flags * 'aReturns unsupported attributes.
* Defining attributes.
type 'a key_parser = ?loc:Loc.t -> 'a option -> vernac_flag_value -> 'aA parser for some key in an attribute. It is given a nonempty 'a
option when the attribute is multiply set for some command.
eg in #[polymorphic] Monomorphic Definition foo := ..., when parsing Monomorphic it will be given Some true.
val attribute_of_list : (string * 'a key_parser) list -> 'a option attributeMake an attribute from a list of key parsers together with their associated key.
val payload_parser : ?cat:(string -> string -> string) -> name:string -> string key_parserpayload_parser ?cat ~name parses attributes like #[name="payload"]. If the attribute is used multiple times and cat is non-None, the payloads are concatenated using it. If cat is None, having multiple occurences of the attribute is forbidden.
val payload_attribute : ?cat:(string -> string -> string) -> name:string ->
string option attributeThis is just attribute_of_list for a single payload_parser.
val bool_attribute : name:string -> bool option attributeDefine boolean attribute name, of the form name={yes,no}. The attribute may only be set once for a command.
qualified_attribute qual att treats #[qual(atts)] like att treats atts.
Combinators to help define your own parsers. See the implementation of bool_attribute for practical use.
val assert_empty : ?loc:Loc.t -> string -> vernac_flag_value -> unitassert_empty key v errors if v is not empty. key is used in the error message as the name of the attribute.
val assert_once : ?loc:Loc.t -> name:string -> 'a option -> unitassert_once ~name v errors if v is not empty. name is used in the error message as the name of the attribute. Used to ensure that a given attribute is not reapeated.
val single_key_parser : name:string -> key:string -> 'a -> 'a key_parsersingle_key_parser ~name ~key v makes a parser for attribute name giving the constant value v for key key taking no arguments. name may only be given once.
val make_attribute : (vernac_flags -> vernac_flags * 'a) -> 'a attributeMake an attribute using the internal representation, thus with access to the full power of attributes. Unstable.
val vernac_polymorphic_flag : Loc.t option -> vernac_flagCompatibility values for parsing Polymorphic.
val vernac_monomorphic_flag : Loc.t option -> vernac_flag