diff options
author | 2015-01-21 00:26:59 +0100 | |
---|---|---|
committer | 2015-01-21 00:46:06 +0100 | |
commit | c2d053c6f38a54e3083c8726eccb3e73942107b7 (patch) | |
tree | 2eef9978ece47590799ab97acfe9043e213b8d40 /parsing/egramcoq.ml | |
parent | 9cc95f5a34b9050fe5a869f0fb96da562b45353d (diff) |
Embedding the index of the ML tactic entry in the Tacexpr AST.
This will allow to get rid of the fragile mechanism of discriminating which
entry to call depending on the dynamic type of its arguments.
Diffstat (limited to 'parsing/egramcoq.ml')
-rw-r--r-- | parsing/egramcoq.ml | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/parsing/egramcoq.ml b/parsing/egramcoq.ml index 01194c60d..d9eb5d412 100644 --- a/parsing/egramcoq.ml +++ b/parsing/egramcoq.ml @@ -258,8 +258,12 @@ type all_grammar_command = let add_ml_tactic_entry name prods = let entry = weaken_entry Tactic.simple_tactic in - let mkact loc l : raw_tactic_expr = Tacexpr.TacML (loc, name, List.map snd l) in - let rules = List.map (make_rule mkact) prods in + let mkact i loc l : raw_tactic_expr = + let open Tacexpr in + let entry = { mltac_name = name; mltac_index = i } in + TacML (loc, entry, List.map snd l) + in + let rules = List.map_i (fun i p -> make_rule (mkact i) p) 0 prods in synchronize_level_positions (); grammar_extend entry None (None ,[(None, None, List.rev rules)]); 1 |