From 14f6e7940436909c6f3bc1cc9f01464a556c1a45 Mon Sep 17 00:00:00 2001 From: herbelin Date: Thu, 1 May 2008 16:28:08 +0000 Subject: Clarification de l'ordre d'interprétation des variables dans ltac. En particulier, TacCall(_,f,[]) est utilisé pour une référence à une variable ltac ou une tactique et Reference(f) est utilisé pour une référence à une variable ltac ou un constr (en passant, standardisation de l'utilisation de constr: ou ltac: à setoid_ring). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@10878 85f007b7-540e-0410-9357-904b9bb8a0f7 --- parsing/g_ltac.ml4 | 14 ++++---------- parsing/pptactic.ml | 1 + 2 files changed, 5 insertions(+), 10 deletions(-) (limited to 'parsing') diff --git a/parsing/g_ltac.ml4 b/parsing/g_ltac.ml4 index f7a538720..eefbe7da0 100644 --- a/parsing/g_ltac.ml4 +++ b/parsing/g_ltac.ml4 @@ -25,11 +25,6 @@ let fail_default_value = ArgArg 0 let arg_of_expr = function TacArg a -> a | e -> Tacexp (e:raw_tactic_expr) - -let tacarg_of_expr = function - | TacArg (Reference r) -> TacCall (dummy_loc,r,[]) - | TacArg a -> a - | e -> Tacexp (e:raw_tactic_expr) (* Tactics grammar rules *) @@ -101,9 +96,8 @@ GEXTEND Gram TacArg(ConstrMayEval(ConstrTerm c)) | IDENT "ipattern"; ":"; ipat = simple_intropattern -> TacArg(IntroPattern ipat) - | r = reference; la = LIST1 tactic_arg -> - TacArg(TacCall (loc,r,la)) - | r = reference -> TacArg (Reference r) ] + | r = reference; la = LIST0 tactic_arg -> + TacArg(TacCall (loc,r,la)) ] | "0" [ "("; a = tactic_expr; ")" -> a | a = tactic_atom -> TacArg a ] ] @@ -120,7 +114,7 @@ GEXTEND Gram ; (* Tactic arguments *) tactic_arg: - [ [ IDENT "ltac"; ":"; a = tactic_expr LEVEL "0" -> tacarg_of_expr a + [ [ IDENT "ltac"; ":"; a = tactic_expr LEVEL "0" -> arg_of_expr a | IDENT "ltac"; ":"; n = natural -> Integer n | IDENT "ipattern"; ":"; ipat = simple_intropattern -> IntroPattern ipat | a = may_eval_arg -> a @@ -152,7 +146,7 @@ GEXTEND Gram tactic_atom: [ [ id = METAIDENT -> MetaIdArg (loc,true,id) | n = integer -> Integer n - | r = reference -> Reference r + | r = reference -> TacCall (loc,r,[]) | "()" -> TacVoid ] ] ; match_key: diff --git a/parsing/pptactic.ml b/parsing/pptactic.ml index d4befac1e..57f1e80bd 100644 --- a/parsing/pptactic.ml +++ b/parsing/pptactic.ml @@ -946,6 +946,7 @@ let rec pr_tac inherited tac = pr_may_eval pr_constr pr_lconstr pr_cst c, leval | TacArg(TacFreshId l) -> str "fresh" ++ pr_fresh_ids l, latom | TacArg(Integer n) -> int n, latom + | TacArg(TacCall(loc,f,[])) -> pr_ref f, latom | TacArg(TacCall(loc,f,l)) -> pr_with_comments loc (hov 1 (pr_ref f ++ spc () ++ -- cgit v1.2.3