aboutsummaryrefslogtreecommitdiff
path: root/intf
diff options
context:
space:
mode:
authorMaxime Dénès2017-10-23 14:27:04 +0200
committerMaxime Dénès2018-03-08 17:16:08 +0100
commitb16633a5dc044e5d95c73b4c912ec7232f9caf12 (patch)
tree848f64b9dde07bec3244a2c0137f7dc72b5c06b7 /intf
parent3875a525ee1e075be9f0eb1f17c74726e9f38b43 (diff)
Make most of TACTIC EXTEND macros runtime calls.
Today, TACTIC EXTEND generates ad-hoc ML code that registers the tactic and its parsing rule. Instead, we make it generate a typed AST that is passed to the parser and a generic tactic execution routine. PMP has written a small parser that can generate the same typed ASTs without relying on camlp5, which is overkill for such simple macros.
Diffstat (limited to 'intf')
-rw-r--r--intf/extend.ml9
1 files changed, 9 insertions, 0 deletions
diff --git a/intf/extend.ml b/intf/extend.ml
index 10c9b3dc14..734b859f60 100644
--- a/intf/extend.ml
+++ b/intf/extend.ml
@@ -85,6 +85,15 @@ type 'a user_symbol =
| Uentry of 'a
| Uentryl of 'a * int
+type ('a,'b,'c) ty_user_symbol =
+| TUlist1 : ('a,'b,'c) ty_user_symbol -> ('a list,'b list,'c list) ty_user_symbol
+| TUlist1sep : ('a,'b,'c) ty_user_symbol * string -> ('a list,'b list,'c list) ty_user_symbol
+| TUlist0 : ('a,'b,'c) ty_user_symbol -> ('a list,'b list,'c list) ty_user_symbol
+| TUlist0sep : ('a,'b,'c) ty_user_symbol * string -> ('a list,'b list,'c list) ty_user_symbol
+| TUopt : ('a,'b,'c) ty_user_symbol -> ('a option, 'b option, 'c option) ty_user_symbol
+| TUentry : ('a, 'b, 'c) Genarg.ArgT.tag -> ('a,'b,'c) ty_user_symbol
+| TUentryl : ('a, 'b, 'c) Genarg.ArgT.tag * int -> ('a,'b,'c) ty_user_symbol
+
(** {5 Type-safe grammar extension} *)
type ('self, 'a) symbol =