diff options
| author | herbelin | 2011-10-25 21:02:53 +0000 |
|---|---|---|
| committer | herbelin | 2011-10-25 21:02:53 +0000 |
| commit | b020c6c4d9f1fdd5f5e17f0b08151a18f021f8d3 (patch) | |
| tree | 14e9e94fe5bddb75916485c1dce76baad6f32fef /parsing | |
| parent | b91f721df622b40e1f4ca610dd4a5697d27ec56a (diff) | |
Applying Tom Prince's patch to support parametric "constructor n" in
tactic notations and ltac definitions (see bug report #2496).
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@14606 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'parsing')
| -rw-r--r-- | parsing/g_tactic.ml4 | 10 | ||||
| -rw-r--r-- | parsing/pptactic.ml | 2 | ||||
| -rw-r--r-- | parsing/q_coqast.ml4 | 2 |
3 files changed, 4 insertions, 10 deletions
diff --git a/parsing/g_tactic.ml4 b/parsing/g_tactic.ml4 index 9f4b10575e..f1b3ffed42 100644 --- a/parsing/g_tactic.ml4 +++ b/parsing/g_tactic.ml4 @@ -218,12 +218,6 @@ GEXTEND Gram (* This is used in quotations *) | id = METAIDENT -> MetaId (loc,id) ] ] ; - (* A number or a quotation meta-variable *) - num_or_meta: - [ [ n = integer -> AI n - | id = METAIDENT -> MetaId (loc,id) - ] ] - ; open_constr: [ [ c = constr -> ((),c) ] ] ; @@ -638,9 +632,9 @@ GEXTEND Gram | "exists"; bll = LIST1 opt_bindings SEP "," -> TacSplit (false,true,bll) | IDENT "eexists"; bll = LIST1 opt_bindings SEP "," -> TacSplit (true,true,bll) - | IDENT "constructor"; n = num_or_meta; l = with_bindings -> + | IDENT "constructor"; n = nat_or_var; l = with_bindings -> TacConstructor (false,n,l) - | IDENT "econstructor"; n = num_or_meta; l = with_bindings -> + | IDENT "econstructor"; n = nat_or_var; l = with_bindings -> TacConstructor (true,n,l) | IDENT "constructor"; t = OPT tactic -> TacAnyConstructor (false,t) | IDENT "econstructor"; t = OPT tactic -> TacAnyConstructor (true,t) diff --git a/parsing/pptactic.ml b/parsing/pptactic.ml index b781e4e6e2..fd4c1bcea0 100644 --- a/parsing/pptactic.ml +++ b/parsing/pptactic.ml @@ -788,7 +788,7 @@ and pr_atom1 = function | TacAnyConstructor (ev,None) as t -> pr_atom0 t | TacConstructor (ev,n,l) -> hov 1 (str (with_evars ev "constructor") ++ - pr_or_metaid pr_intarg n ++ pr_bindings l) + pr_or_var pr_intarg n ++ pr_bindings l) (* Conversion *) | TacReduce (r,h) -> diff --git a/parsing/q_coqast.ml4 b/parsing/q_coqast.ml4 index a155015b5f..e184eafe37 100644 --- a/parsing/q_coqast.ml4 +++ b/parsing/q_coqast.ml4 @@ -381,7 +381,7 @@ let rec mlexpr_of_atomic_tactic = function | Tacexpr.TacAnyConstructor (ev,t) -> <:expr< Tacexpr.TacAnyConstructor $mlexpr_of_bool ev$ $mlexpr_of_option mlexpr_of_tactic t$>> | Tacexpr.TacConstructor (ev,n,l) -> - let n = mlexpr_of_or_metaid mlexpr_of_int n in + let n = mlexpr_of_or_var mlexpr_of_int n in <:expr< Tacexpr.TacConstructor $mlexpr_of_bool ev$ $n$ $mlexpr_of_binding_kind l$>> (* Conversion *) |
