diff options
| author | Pierre-Marie Pédrot | 2020-10-27 13:31:44 +0100 |
|---|---|---|
| committer | Pierre-Marie Pédrot | 2020-10-27 13:31:44 +0100 |
| commit | b87fd6cfe5fe872a38d98c294aea84cde8c6c160 (patch) | |
| tree | 060327d404f1e9fcf198aff8d5f075ec498f261e /vernac | |
| parent | 82f7cc4a408cf100fda43139c0b1d33e33748799 (diff) | |
| parent | 30f97beb1bfc149d9608cb74f24f69f268671e04 (diff) | |
Merge PR #13167: Ltac2: use ComTactic infrastructure
Reviewed-by: ejgallego
Reviewed-by: gares
Reviewed-by: ppedrot
Diffstat (limited to 'vernac')
| -rw-r--r-- | vernac/comTactic.ml | 6 | ||||
| -rw-r--r-- | vernac/comTactic.mli | 9 |
2 files changed, 9 insertions, 6 deletions
diff --git a/vernac/comTactic.ml b/vernac/comTactic.ml index 8a9a412362..2252d46e58 100644 --- a/vernac/comTactic.ml +++ b/vernac/comTactic.ml @@ -16,13 +16,13 @@ module DMap = Dyn.Map(struct type 'a t = 'a -> unit Proofview.tactic end) let interp_map = ref DMap.empty -type 'a tactic_interpreter = 'a Dyn.tag -type interpretable = I : 'a tactic_interpreter * 'a -> interpretable +type interpretable = I : 'a Dyn.tag * 'a -> interpretable +type 'a tactic_interpreter = Interpreter of ('a -> interpretable) let register_tactic_interpreter na f = let t = Dyn.create na in interp_map := DMap.add t f !interp_map; - t + Interpreter (fun x -> I (t,x)) let interp_tac (I (tag,t)) = let f = DMap.find tag !interp_map in diff --git a/vernac/comTactic.mli b/vernac/comTactic.mli index f1a75e1b6a..72e71d013a 100644 --- a/vernac/comTactic.mli +++ b/vernac/comTactic.mli @@ -9,10 +9,13 @@ (************************************************************************) (** Tactic interpreters have to register their interpretation function *) -type 'a tactic_interpreter -type interpretable = I : 'a tactic_interpreter * 'a -> interpretable +type interpretable -(** ['a] should be marshallable if ever used with [par:] *) +type 'a tactic_interpreter = private Interpreter of ('a -> interpretable) + +(** ['a] should be marshallable if ever used with [par:]. Must be + called no more than once per process with a particular string: make + sure to use partial application. *) val register_tactic_interpreter : string -> ('a -> unit Proofview.tactic) -> 'a tactic_interpreter |
