diff options
Diffstat (limited to 'grammar')
-rw-r--r-- | grammar/grammar.mllib | 1 | ||||
-rw-r--r-- | grammar/q_util.ml4 | 13 | ||||
-rw-r--r-- | grammar/tacextend.ml4 | 6 |
3 files changed, 16 insertions, 4 deletions
diff --git a/grammar/grammar.mllib b/grammar/grammar.mllib index 60ea0df02..7e4eea641 100644 --- a/grammar/grammar.mllib +++ b/grammar/grammar.mllib @@ -51,6 +51,7 @@ Constrexpr_ops Compat Tok Lexer +Entry Pcoq G_prim G_tactic diff --git a/grammar/q_util.ml4 b/grammar/q_util.ml4 index 20c83dfaf..5ec7510f7 100644 --- a/grammar/q_util.ml4 +++ b/grammar/q_util.ml4 @@ -58,6 +58,13 @@ let rec mlexpr_of_prod_entry_key : type s a. (s, a) Pcoq.entry_key -> _ = functi | Pcoq.Amodifiers s -> <:expr< Pcoq.Amodifiers $mlexpr_of_prod_entry_key s$ >> | Pcoq.Aself -> <:expr< Pcoq.Aself >> | Pcoq.Anext -> <:expr< Pcoq.Anext >> - | Pcoq.Aentry ("",s) -> <:expr< Pcoq.Aentry (Pcoq.name_of_entry $lid:s$) >> - | Pcoq.Aentry (u,s) -> <:expr< Pcoq.Aentry ($str:u$, $str:s$) >> - | Pcoq.Aentryl ((u,s), l) -> <:expr< Pcoq.Aentryl ($str:u$, $str:s$) $mlexpr_of_int l$ >> + | Pcoq.Aentry e -> + begin match Entry.repr e with + | Entry.Dynamic s -> <:expr< Pcoq.Aentry (Pcoq.name_of_entry $lid:s$) >> + | Entry.Static (u, s) -> <:expr< Pcoq.Aentry (Entry.unsafe_of_name ($str:u$, $str:s$)) >> + end + | Pcoq.Aentryl (e, l) -> + begin match Entry.repr e with + | Entry.Dynamic s -> <:expr< Pcoq.Aentryl (Pcoq.name_of_entry $lid:s$) >> + | Entry.Static (u, s) -> <:expr< Pcoq.Aentryl (Entry.unsafe_of_name ($str:u$, $str:s$)) $mlexpr_of_int l$ >> + end diff --git a/grammar/tacextend.ml4 b/grammar/tacextend.ml4 index 70151cef1..4709a7998 100644 --- a/grammar/tacextend.ml4 +++ b/grammar/tacextend.ml4 @@ -162,7 +162,11 @@ let is_constr_gram = function | GramTerminal _ -> false | GramNonTerminal (_, _, e, _) -> match e with - | Aentry ("constr", "constr") -> true + | Aentry e -> + begin match Entry.repr e with + | Entry.Static ("constr", "constr") -> true + | _ -> false + end | _ -> false let make_var = function |