diff options
author | Emilio Jesus Gallego Arias <e+git@x80.org> | 2017-11-20 12:26:59 +0100 |
---|---|---|
committer | Emilio Jesus Gallego Arias <e+git@x80.org> | 2017-11-22 22:47:57 +0100 |
commit | ce418aea93a6396412de57aded0ff092bec7596b (patch) | |
tree | f5ed6b63390ba472a5b20e0ff6ef5398f30db41e /vernac/vernacinterp.ml | |
parent | eb91ccaf236bc9a60a1e216b76a0a42980c072a7 (diff) |
[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.
Diffstat (limited to 'vernac/vernacinterp.ml')
-rw-r--r-- | vernac/vernacinterp.ml | 15 |
1 files changed, 12 insertions, 3 deletions
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 |