aboutsummaryrefslogtreecommitdiffhomepage
path: root/parsing
diff options
context:
space:
mode:
authorGravatar corbinea <corbinea@85f007b7-540e-0410-9357-904b9bb8a0f7>2003-11-06 14:35:25 +0000
committerGravatar corbinea <corbinea@85f007b7-540e-0410-9357-904b9bb8a0f7>2003-11-06 14:35:25 +0000
commita008023cae4fdddffbbbfd8a455d7776200a9cfb (patch)
treec2b82f43339ee45d614395d7350d6b53a8364437 /parsing
parentb74a68a56164f952345ba083f42b95eaaa37355e (diff)
Added Instantiate ... in
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@4820 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'parsing')
-rw-r--r--parsing/g_tactic.ml45
-rw-r--r--parsing/g_tacticnew.ml47
-rw-r--r--parsing/pptactic.ml6
3 files changed, 11 insertions, 7 deletions
diff --git a/parsing/g_tactic.ml4 b/parsing/g_tactic.ml4
index 47977b69b..74352c0bb 100644
--- a/parsing/g_tactic.ml4
+++ b/parsing/g_tactic.ml4
@@ -292,8 +292,9 @@ GEXTEND Gram
| IDENT "Generalize"; IDENT "Dependent"; c = constr -> TacGeneralizeDep c
| IDENT "LetTac"; id = base_ident; ":="; c = constr; p = clause_pattern
-> TacLetTac (id,c,p)
- | IDENT "Instantiate"; n = natural; c = constr -> TacInstantiate (n,c)
-
+ | IDENT "Instantiate"; n = natural; c = constr;
+ ido = OPT [ "in"; id = id_or_ltac_ref -> id ] ->
+ TacInstantiate (n,c,ido)
| IDENT "Specialize"; n = OPT natural; lcb = constr_with_bindings ->
TacSpecialize (n,lcb)
| IDENT "LApply"; c = constr -> TacLApply c
diff --git a/parsing/g_tacticnew.ml4 b/parsing/g_tacticnew.ml4
index 59dd34769..d98f8ad45 100644
--- a/parsing/g_tacticnew.ml4
+++ b/parsing/g_tacticnew.ml4
@@ -344,9 +344,10 @@ GEXTEND Gram
TacGeneralizeDep c
| IDENT "set"; "("; id = base_ident; ":="; c = lconstr; ")";
p = clause_pattern -> TacLetTac (id,c,p)
- | IDENT "instantiate"; "("; n = natural; ":="; c = lconstr; ")" ->
- TacInstantiate (n,c)
-
+ | IDENT "instantiate"; "("; n = natural; ":="; c = lconstr; ")";
+ ido = OPT [ "in"; id = id_or_meta -> id ] ->
+ TacInstantiate (n,c,ido)
+
| IDENT "specialize"; n = OPT natural; lcb = constr_with_bindings ->
TacSpecialize (n,lcb)
| IDENT "lapply"; c = constr -> TacLApply c
diff --git a/parsing/pptactic.ml b/parsing/pptactic.ml
index 9e1e3498f..8f0a29c64 100644
--- a/parsing/pptactic.ml
+++ b/parsing/pptactic.ml
@@ -454,9 +454,11 @@ and pr_atom1 = function
| TacLetTac (id,c,cl) ->
hov 1 (str "LetTac" ++ spc () ++ pr_id id ++ str ":=" ++
pr_constr c ++ pr_clause_pattern pr_ident cl)
- | TacInstantiate (n,c) ->
+ | TacInstantiate (n,c,None) ->
hov 1 (str "Instantiate" ++ pr_arg int n ++ pr_arg pr_constr c)
-
+ | TacInstantiate (n,c,Some id) ->
+ hov 1 (str "Instantiate" ++ pr_arg int n ++ pr_arg pr_constr c ++
+ spc () ++ str "in" ++ pr_arg pr_ident id)
(* Derived basic tactics *)
| TacSimpleInduction h ->
hov 1 (str "Induction" ++ pr_arg pr_quantified_hypothesis h)