diff options
author | herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2008-05-01 16:28:08 +0000 |
---|---|---|
committer | herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2008-05-01 16:28:08 +0000 |
commit | 14f6e7940436909c6f3bc1cc9f01464a556c1a45 (patch) | |
tree | e63f2c96ab9389010bb85f56ef1c6b89b36cd6e4 /parsing | |
parent | 4f9cf134a3763de4ec5a5720edb11bb1e6eca66b (diff) |
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).
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@10878 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'parsing')
-rw-r--r-- | parsing/g_ltac.ml4 | 14 | ||||
-rw-r--r-- | parsing/pptactic.ml | 1 |
2 files changed, 5 insertions, 10 deletions
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 () ++ |