X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Focaml%2Fcic_disambiguation%2FcicTextualParser2.ml;h=352c925fbba057947ede41bab2f91fec9f6aa929;hb=5a136ee51c0e52ea2ee14420b1f15bc0106eb388;hp=3fdda212d83339aac2c681bbdcc573eac5361e66;hpb=c91796631682cba2972b964c7570c3437ccd971f;p=helm.git diff --git a/helm/ocaml/cic_disambiguation/cicTextualParser2.ml b/helm/ocaml/cic_disambiguation/cicTextualParser2.ml index 3fdda212d..352c925fb 100644 --- a/helm/ocaml/cic_disambiguation/cicTextualParser2.ml +++ b/helm/ocaml/cic_disambiguation/cicTextualParser2.ml @@ -352,6 +352,10 @@ EXTEND depth = OPT [ IDENT "depth"; SYMBOL "="; i = NUM -> int_of_string i ]; width = OPT [ IDENT "depth"; SYMBOL "="; i = NUM -> int_of_string i ] -> TacticAst.Auto (loc,depth,width) + | IDENT "clear"; id = IDENT -> + TacticAst.Clear (loc,id) + | IDENT "clearbody"; id = IDENT -> + TacticAst.ClearBody (loc,id) | IDENT "change"; t1 = tactic_term; "with"; t2 = tactic_term; "in"; where = pattern_spec -> TacticAst.Change (loc, t1, t2, where) @@ -378,8 +382,11 @@ EXTEND TacticAst.Exact (loc, t) | IDENT "exists" -> TacticAst.Exists loc - | IDENT "fold"; kind = reduction_kind; t = tactic_term -> - TacticAst.Fold (loc, kind, t) + | IDENT "fail" -> TacticAst.Fail loc + | IDENT "fold"; kind = reduction_kind; t = tactic_term; + p = OPT [ pattern_spec ] -> + let p = match p with None -> [], None | Some p -> p in + TacticAst.Fold (loc, kind, t, p) | IDENT "fourier" -> TacticAst.Fourier loc | IDENT "fwd"; t = term -> @@ -391,6 +398,7 @@ EXTEND TacticAst.Generalize (loc,t,id,p) | IDENT "goal"; n = NUM -> TacticAst.Goal (loc, int_of_string n) + | IDENT "id" -> TacticAst.IdTac loc | IDENT "injection"; t = term -> TacticAst.Injection (loc, t) | IDENT "intros"; num = OPT [num = int -> num]; idents = OPT ident_list0 -> @@ -400,8 +408,9 @@ EXTEND let idents = match ident with None -> [] | Some id -> [id] in TacticAst.Intros (loc, Some 1, idents) | IDENT "lapply"; what = tactic_term; - to_what = OPT [ "to" ; t = tactic_term -> t ] -> - TacticAst.LApply (loc, to_what, what) + to_what = OPT [ "to" ; t = tactic_term -> t ]; + ident = OPT [ "using" ; id = IDENT -> id ] -> + TacticAst.LApply (loc, to_what, what, ident) | IDENT "left" -> TacticAst.Left loc | IDENT "letin"; where = IDENT ; SYMBOL <:unicode> ; t = tactic_term -> TacticAst.LetIn (loc, t, where) @@ -410,8 +419,9 @@ EXTEND TacticAst.Reduce (loc, kind, p) | IDENT "reflexivity" -> TacticAst.Reflexivity loc - | IDENT "replace"; t1 = tactic_term; "with"; t2 = tactic_term -> - TacticAst.Replace (loc, t1, t2) + | IDENT "replace"; p = OPT [ pattern_spec ]; "with"; t = tactic_term -> + let p = match p with None -> [], None | Some p -> p in + TacticAst.Replace (loc, p, t) | IDENT "rewrite" ; d = direction; t = term ; p = OPT [ pattern_spec ] -> let p = match p with None -> [], None | Some p -> p in TacticAst.Rewrite (loc, d, t, p) @@ -449,8 +459,6 @@ EXTEND TacticAst.Tries (loc, tacs) | IDENT "try"; tac = NEXT -> TacticAst.Try (loc, tac) - | IDENT "fail" -> TacticAst.Fail loc - | IDENT "id" -> TacticAst.IdTac loc | PAREN "("; tac = tactical; PAREN ")" -> tac | tac = tactic -> TacticAst.Tactic (loc, tac) ] @@ -562,8 +570,9 @@ EXTEND ]; command: [[ - [ IDENT "set" ]; n = QSTRING; v = QSTRING -> + [ IDENT "set" ]; n = QSTRING; v = QSTRING -> TacticAst.Set (loc, n, v) + | [ IDENT "drop" ] -> TacticAst.Drop loc | [ IDENT "qed" ] -> TacticAst.Qed loc | flavour = theorem_flavour; name = IDENT; SYMBOL ":"; typ = term; body = OPT [ SYMBOL <:unicode> (* ≝ *); body = term -> body ] ->