From ce418aea93a6396412de57aded0ff092bec7596b Mon Sep 17 00:00:00 2001 From: Emilio Jesus Gallego Arias Date: Mon, 20 Nov 2017 12:26:59 +0100 Subject: [plugin] Encapsulate modifiers to vernac commands. This is a continuation on #6183 and another step towards a more functional interpretation of commands. In particular, this should allow us to remove the locality hack. --- vernac/vernacinterp.ml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'vernac/vernacinterp.ml') diff --git a/vernac/vernacinterp.ml b/vernac/vernacinterp.ml index 1d024386e..725436fef 100644 --- a/vernac/vernacinterp.ml +++ b/vernac/vernacinterp.ml @@ -11,8 +11,16 @@ open Pp open CErrors type deprecation = bool -type vernac_command = Genarg.raw_generic_argument list -> Loc.t option -> - Vernacstate.t -> Vernacstate.t + +type atts = { + loc : Loc.t option; + locality : bool option; +} + +type vernac_command = + Genarg.raw_generic_argument list -> + atts:atts -> st:Vernacstate.t -> + Vernacstate.t (* Table of vernac entries *) let vernac_tab = @@ -67,7 +75,8 @@ let call ?locality ?loc (opn,converted_args) = let hunk = callback converted_args in phase := "Executing command"; Locality.LocalityFixme.set locality; - let res = hunk loc in + let atts = { loc; locality } in + let res = hunk ~atts in Locality.LocalityFixme.assert_consumed (); res with -- cgit v1.2.3