From a008023cae4fdddffbbbfd8a455d7776200a9cfb Mon Sep 17 00:00:00 2001 From: corbinea Date: Thu, 6 Nov 2003 14:35:25 +0000 Subject: Added Instantiate ... in git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@4820 85f007b7-540e-0410-9357-904b9bb8a0f7 --- parsing/g_tactic.ml4 | 5 +++-- parsing/g_tacticnew.ml4 | 7 ++++--- parsing/pptactic.ml | 6 ++++-- 3 files changed, 11 insertions(+), 7 deletions(-) (limited to 'parsing') 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) -- cgit v1.2.3