X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;ds=sidebyside;f=helm%2Focaml%2Fcic_disambiguation%2FcicTextualParser2.ml;h=431b15ae83d807617aeef459fbec3d9e621ac068;hb=3b4ce4f34c41a0a588cbb02e69a728d296b75359;hp=486c26a7475a5332f9839d838b52a8cff38719e9;hpb=1e18c75052e7839db7945b4cbd08f460aa57826c;p=helm.git diff --git a/helm/ocaml/cic_disambiguation/cicTextualParser2.ml b/helm/ocaml/cic_disambiguation/cicTextualParser2.ml index 486c26a74..431b15ae8 100644 --- a/helm/ocaml/cic_disambiguation/cicTextualParser2.ml +++ b/helm/ocaml/cic_disambiguation/cicTextualParser2.ml @@ -250,8 +250,6 @@ EXTEND b = binder_low; (vars, typ) = binder_vars; SYMBOL "."; body = term -> let binder = mk_binder_ast b typ vars body in return_term loc binder - | t1 = term; SYMBOL <:unicode> (* → *); t2 = term -> - return_term loc (CicAst.Binder (`Pi, (Cic.Anonymous, Some t1), t2)) ] | "logic_add" LEFTA [ (* nothing here by default *) ] | "logic_mult" LEFTA [ (* nothing here by default *) ] @@ -277,6 +275,8 @@ EXTEND b = binder_high; (vars, typ) = binder_vars; SYMBOL "."; body = term -> let binder = mk_binder_ast b typ vars body in return_term loc binder + | t1 = term; SYMBOL <:unicode> (* → *); t2 = term -> + return_term loc (CicAst.Binder (`Pi, (Cic.Anonymous, Some t1), t2)) ] | "simple" NONA [ sort = sort -> CicAst.Sort sort @@ -391,7 +391,7 @@ EXTEND (match (pat, terms) with | None, [] -> TacticAst.Reduce (loc, kind, None) | None, terms -> TacticAst.Reduce (loc, kind, Some (terms, `Goal)) - | Some pat, [] -> TacticAst.Reduce (loc, kind, Some ([], pat)) + | Some pat, [] -> fail loc "Missing term [list]" | Some pat, terms -> TacticAst.Reduce (loc, kind, Some (terms, pat))) | [ IDENT "reflexivity" ] -> TacticAst.Reflexivity loc @@ -484,8 +484,16 @@ EXTEND | [ IDENT "check" ]; t = term -> TacticAst.Check (loc, t) | [ IDENT "hint" ] -> TacticAst.Hint loc - | [ IDENT "pmatch" ] ; t = term -> TacticAst.Match (loc,t) - | [ IDENT "instance" ] ; t = term -> TacticAst.Instance (loc,t) + | [ IDENT "whelp"; "match" ] ; t = term -> + TacticAst.WMatch (loc,t) + | [ IDENT "whelp"; IDENT "instance" ] ; t = term -> + TacticAst.WInstance (loc,t) + | [ IDENT "whelp"; IDENT "locate" ] ; id = IDENT -> + TacticAst.WLocate (loc,id) + | [ IDENT "whelp"; IDENT "elim" ] ; t = term -> + TacticAst.WElim (loc, t) + | [ IDENT "whelp"; IDENT "hint" ] ; t = term -> + TacticAst.WHint (loc,t) | [ IDENT "print" ]; name = QSTRING -> TacticAst.Print (loc, name) ]]; @@ -563,12 +571,26 @@ EXTEND TacticAst.Alias (loc, spec) ]]; - statement: [ + executable: [ [ cmd = command; SYMBOL "." -> TacticAst.Command (loc, cmd) | tac = tactical; SYMBOL "." -> TacticAst.Tactical (loc, tac) | mac = macro; SYMBOL "." -> TacticAst.Macro (loc, mac) ] ]; + + comment: [ + [ BEGINCOMMENT ; ex = executable ; ENDCOMMENT -> + TacticAst.Code (loc, ex) + | str = NOTE -> + TacticAst.Note (loc, str) + ] + ]; + + statement: [ + [ ex = executable -> TacticAst.Executable (loc,ex) + | com = comment -> TacticAst.Comment (loc, com) + ] + ]; END let exc_located_wrapper f =