diff options
| author | herbelin | 2003-06-19 20:18:43 +0000 |
|---|---|---|
| committer | herbelin | 2003-06-19 20:18:43 +0000 |
| commit | 37848b4e597a0fff00999215503ed443b6dec767 (patch) | |
| tree | fba858e20c2032ff3856d89a99594f5fd5a6e2e4 | |
| parent | b776399af9388fc4bbfeb9cd87ab3410e2e304be (diff) | |
Ajout 'Symmetry in Hyp'; chgt syntaxe 'change ... with ...'
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@4184 85f007b7-540e-0410-9357-904b9bb8a0f7
| -rw-r--r-- | parsing/g_tacticnew.ml4 | 11 | ||||
| -rw-r--r-- | translate/pptacticnew.ml | 13 |
2 files changed, 15 insertions, 9 deletions
diff --git a/parsing/g_tacticnew.ml4 b/parsing/g_tacticnew.ml4 index c45dc332f8..a204c017fb 100644 --- a/parsing/g_tacticnew.ml4 +++ b/parsing/g_tacticnew.ml4 @@ -129,10 +129,10 @@ GEXTEND Gram | n = natural -> AnonHyp n ] ] ; conversion: - [ [ nl = LIST1 integer; c1 = constr; "with"; c2 = constr -> - (Some (nl,c1), c2) - | c1 = constr; "with"; c2 = constr -> (Some ([],c1), c2) - | c = constr -> (None, c) ] ] + [ [ c = constr -> (None, c) + | c1 = constr; "with"; c2 = constr -> (Some ([],c1), c2) + | c1 = constr; IDENT "at"; nl = LIST1 integer; "with"; c2 = constr -> + (Some (nl,c1), c2) ] ] ; pattern_occ: [ [ nl = LIST0 integer; c = [c=constr->c | g=global->Topconstr.CRef g]-> (nl,c) ] ] @@ -335,7 +335,8 @@ GEXTEND Gram (* Equivalence relations *) | IDENT "reflexivity" -> TacReflexivity - | IDENT "symmetry" -> TacSymmetry + | IDENT "symmetry"; ido = OPT [ "in"; id = id_or_ltac_ref -> id ] -> + TacSymmetry ido | IDENT "transitivity"; c = lconstr -> TacTransitivity c (* Conversion *) diff --git a/translate/pptacticnew.ml b/translate/pptacticnew.ml index 2bbb2d0821..4e403b4857 100644 --- a/translate/pptacticnew.ml +++ b/translate/pptacticnew.ml @@ -198,7 +198,7 @@ let rec pr_atom0 env = function | TacAutoTDB None -> str "autotdb" | TacDestructConcl -> str "dconcl" | TacReflexivity -> str "reflexivity" - | TacSymmetry -> str "symmetry" + | TacSymmetry None -> str "symmetry" | t -> str "(" ++ pr_atom1 env t ++ str ")" (* Main tactic printer *) @@ -351,12 +351,17 @@ and pr_atom1 env = function (match occ with None -> mt() | Some(ocl,c1) -> - hov 1 (prlist (fun i -> int i ++ spc()) ocl ++ - pr_constr env c1) ++ spc() ++ str "with ") ++ + hov 1 (pr_constr env c1 ++ spc() ++ + if ocl <> [] then + str "at " ++ prlist (fun i -> int i ++ spc()) ocl + else + mt ()) ++ + spc() ++ str "with ") ++ pr_constr env c ++ pr_clause pr_ident h) (* Equivalence relations *) - | (TacReflexivity | TacSymmetry) as x -> pr_atom0 env x + | (TacReflexivity | TacSymmetry None) as x -> pr_atom0 env x + | TacSymmetry (Some id) -> str "symmetry " ++ pr_ident id | TacTransitivity c -> str "transitivity" ++ pr_lconstrarg env c in let ltop = (5,E) in |
