X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Focaml%2Fcic_disambiguation%2FcicTextualParser2.ml;h=fddf27e9995a100f72df291fcc478def9cf601fd;hb=1fe616bda25a6208c4d19f61220e570c71bcc25a;hp=775f13f7d7e0f8803baa7f1a58f9408fd17cc8fa;hpb=bc399fb172ecd3b598844a99eefb817ee0675e3d;p=helm.git diff --git a/helm/ocaml/cic_disambiguation/cicTextualParser2.ml b/helm/ocaml/cic_disambiguation/cicTextualParser2.ml index 775f13f7d..fddf27e99 100644 --- a/helm/ocaml/cic_disambiguation/cicTextualParser2.ml +++ b/helm/ocaml/cic_disambiguation/cicTextualParser2.ml @@ -240,9 +240,9 @@ EXTEND [ PAREN "["; idents = LIST1 IDENT SEP SYMBOL ";"; PAREN "]" -> idents ] ]; reduction_kind: [ - [ "reduce" -> `Reduce - | "simpl" -> `Simpl - | "whd" -> `Whd ] + [ [ IDENT "reduce" | IDENT "Reduce" ] -> `Reduce + | [ IDENT "simplify" | IDENT "Simplify" ] -> `Simpl + | [ IDENT "whd" | IDENT "Whd" ] -> `Whd ] ]; tactic: [ [ [ IDENT "absurd" | IDENT "Absurd" ]; t = tactic_term -> @@ -296,7 +296,20 @@ EXTEND | [ "let" | "Let" ]; t = tactic_term; "in"; where = IDENT -> return_tactic loc (TacticAst.LetIn (t, where)) - (* TODO Reduce *) + | kind = reduction_kind; + pat = OPT [ + "in"; pat = [ IDENT "goal" -> `Goal | IDENT "hyp" -> `Everywhere ] -> + pat + ]; + terms = LIST0 term SEP SYMBOL "," -> + let tac = + (match (pat, terms) with + | None, [] -> TacticAst.Reduce (kind, None) + | None, terms -> TacticAst.Reduce (kind, Some (terms, `Goal)) + | Some pat, [] -> TacticAst.Reduce (kind, Some ([], pat)) + | Some pat, terms -> TacticAst.Reduce (kind, Some (terms, pat))) + in + return_tactic loc tac | [ IDENT "reflexivity" | IDENT "Reflexivity" ] -> return_tactic loc TacticAst.Reflexivity | [ IDENT "replace" | IDENT "Replace" ];