X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=components%2Fgrafite_parser%2FgrafiteParser.ml;h=3eb64d458fe2892a44f32af5bb1ce5e0af0db1fb;hb=ef5ae17d3b2dc045ac27bd2e59c89ffc85b4bd9c;hp=f3dd386a91540b15c729dbf22a0b4c7c25fcaf4a;hpb=68d46ac40a575f3fce5958fb2776b38739703951;p=helm.git diff --git a/components/grafite_parser/grafiteParser.ml b/components/grafite_parser/grafiteParser.ml index f3dd386a9..3eb64d458 100644 --- a/components/grafite_parser/grafiteParser.ml +++ b/components/grafite_parser/grafiteParser.ml @@ -60,10 +60,6 @@ type by_continuation = | BYC_letsuchthat of string * CicNotationPt.term * string * CicNotationPt.term | BYC_wehaveand of string * CicNotationPt.term * string * CicNotationPt.term -let out = ref ignore - -let set_callback f = out := f - EXTEND GLOBAL: term statement; constructor: [ [ name = IDENT; SYMBOL ":"; typ = term -> (name, typ) ] ]; @@ -161,18 +157,20 @@ EXTEND GrafiteAst.Contradiction loc | IDENT "cut"; t = tactic_term; ident = OPT [ "as"; id = IDENT -> id] -> GrafiteAst.Cut (loc, ident, t) - | IDENT "decompose"; types = OPT ident_list0; what = OPT IDENT; - idents = OPT [ "as"; idents = LIST1 IDENT -> idents ] -> - let types = match types with None -> [] | Some types -> types in + | IDENT "decompose"; idents = OPT [ "as"; idents = LIST1 IDENT -> idents ] -> let idents = match idents with None -> [] | Some idents -> idents in - let to_spec id = GrafiteAst.Ident id in - GrafiteAst.Decompose (loc, List.rev_map to_spec types, what, idents) + GrafiteAst.Decompose (loc, idents) | IDENT "demodulate" -> GrafiteAst.Demodulate loc | IDENT "destruct"; t = tactic_term -> GrafiteAst.Destruct (loc, t) - | IDENT "elim"; what = tactic_term; using = using; - (num, idents) = intros_spec -> - GrafiteAst.Elim (loc, what, using, num, idents) + | IDENT "elim"; what = tactic_term; using = using; + pattern = OPT pattern_spec; + (num, idents) = intros_spec -> + let pattern = match pattern with + | None -> None, [], Some Ast.UserInput + | Some pattern -> pattern + in + GrafiteAst.Elim (loc, what, using, pattern, num, idents) | IDENT "elimType"; what = tactic_term; using = using; (num, idents) = intros_spec -> GrafiteAst.ElimType (loc, what, using, num, idents) @@ -260,12 +258,12 @@ EXTEND | BYC_weproved (ty,id,t1) -> GrafiteAst.By_term_we_proved(loc, t', ty, id, t1) | BYC_letsuchthat (id1,t1,id2,t2) -> - (match t with + (* (match t with LNone floc -> raise (HExtlib.Localized (floc,CicNotationParser.Parse_error "tactic_term expected here")) - | LSome t -> GrafiteAst.ExistsElim (loc, t, id1, t1, id2, t2)) + | LSome t ->*) GrafiteAst.ExistsElim (loc, t', id1, t1, id2, t2)(*)*) | BYC_wehaveand (id1,t1,id2,t2) -> (match t with LNone floc -> @@ -678,7 +676,6 @@ EXTEND (loc,GrafiteAst.Include (iloc,buri)))) | scom = lexicon_command ; SYMBOL "." -> fun ~include_paths status -> - !out scom; let status = LexiconEngine.eval_command status scom in status,LNone loc | EOI -> raise End_of_file