(************************************************************************) (* * The Rocq Prover / The Rocq Development Team *) (* v * Copyright INRIA, CNRS and contributors *) (* atts:Attributes.vernac_flags -> unit -> Vernactypes.typed_vernac type plugin_args = Genarg.raw_generic_argument list val type_vernac : Vernacexpr.extend_name -> plugin_args -> vernac_command (** {5 VERNAC EXTEND} *) type classifier = Genarg.raw_generic_argument list -> atts:Attributes.vernac_flags -> vernac_classification type (_, _) ty_sig = | TyNil : (vernac_command, atts:Attributes.vernac_flags -> vernac_classification) ty_sig | TyTerminal : string * ('r, 's) ty_sig -> ('r, 's) ty_sig | TyNonTerminal : ('a, 'b, 'c) Extend.ty_user_symbol * ('r, 's) ty_sig -> ('a -> 'r, 'a -> 's) ty_sig type ty_ml = TyML : bool (* deprecated *) * ('r, 's) ty_sig * 'r * 's option -> ty_ml (** Statically extend vernacular commands. This is used by coqpp VERNAC EXTEND. It should not be used directly, use [declare_dynamic_vernac_extend] instead. Commands added by plugins at Declare ML Module / Require time should provide [plugin]. Commands added without providing [plugin] cannot be removed from the grammar or modified. Not passing [plugin] is possible for non-plugin rocq-runtime commands and deprecated for all other callers. *) val static_vernac_extend : plugin:string option -> command:string -> ?classifier:(atts:Attributes.vernac_flags -> string -> vernac_classification) -> ?entry:Vernacexpr.vernac_expr Procq.Entry.t -> ignore_kw:bool -> ty_ml list -> unit (** Used to tell the system that all future vernac extends are from plugins. *) val static_linking_done : unit -> unit (** Dynamically extend vernacular commands (for instance when importing some module). Reusing a [command] string will replace previous uses. The result is undefined and probably produces anomalies if the previous grammar rule is still active and was different from the new one. The polymorphic arguments are as in [TyML]. The declared grammar extension is disabled, one needs to call [Egramml.extend_vernac_command_grammar] in order to enable it. That call should use [undoable:true] to make it possible to disable the extension, e.g. by backtracking over the command which enabled it. *) val declare_dynamic_vernac_extend : command:Vernacexpr.extend_name -> ?entry:Vernacexpr.vernac_expr Procq.Entry.t -> depr:bool -> 's (* classifier *) -> ('r, 's) ty_sig (* grammar *) -> 'r (* command interpretation *) -> Vernacexpr.extend_name (** {5 VERNAC ARGUMENT EXTEND} *) type 'a argument_rule = | Arg_alias of 'a Procq.Entry.t (** This is used because CAMLP5 parser can be dumb about rule factorization, which sometimes requires two entries to be the same. *) | Arg_rules of 'a Procq.Production.t list (** There is a discrepancy here as we use directly extension rules and thus entries instead of ty_user_symbol and thus arguments as roots. *) type 'a vernac_argument = { arg_printer : Environ.env -> Evd.evar_map -> 'a -> Pp.t; arg_parsing : 'a argument_rule; } val vernac_argument_extend : plugin:string option -> name:string -> ignore_kw:bool -> 'a vernac_argument -> 'a Genarg.vernac_genarg_type * 'a Procq.Entry.t (** {5 STM classifiers} *) val get_vernac_classifier : Vernacexpr.extend_name -> classifier (** Standard constant classifiers *) val classify_as_query : vernac_classification val classify_as_sideeff : vernac_classification val classify_as_proofstep : vernac_classification