]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/components/grafite_parser/grafiteParser.ml
Grammar change: let corecs can take no arguments (and they have no recursive
[helm.git] / matita / components / grafite_parser / grafiteParser.ml
index 480c2de4892e23f10c31dee4a80bca28ce2d0359..1ac21965e3f3fe7090addfada9f812a85067bac1 100644 (file)
@@ -95,6 +95,7 @@ let mk_parser statement lstatus =
 (*   let grammar = CicNotationParser.level2_ast_grammar lstatus in *)
   let term = CicNotationParser.term lstatus in
   let let_defs = CicNotationParser.let_defs lstatus in
+  let let_codefs = CicNotationParser.let_codefs lstatus in
   let protected_binder_vars = CicNotationParser.protected_binder_vars lstatus in
   (* {{{ parser initialization *)
 EXTEND
@@ -128,7 +129,7 @@ EXTEND
   ];
   pattern_spec: [
     [ res = OPT [
-       SYMBOL "{";
+       "in" ;
        wanted_and_sps =
         [ "match" ; wanted = tactic_term ;
           sps = OPT [ "in"; sps = sequent_pattern_spec -> sps ] ->
@@ -136,7 +137,7 @@ EXTEND
         | sps = sequent_pattern_spec ->
            None,Some sps
         ];
-       SYMBOL "}" ->
+       SYMBOL ";" ->
          let wanted,hyp_paths,goal_path =
           match wanted_and_sps with
              wanted,None -> wanted, [], Some N.UserInput
@@ -202,7 +203,7 @@ EXTEND
         G.NMacro(loc,G.Screenshot (loc, fname))
     | IDENT "cases"; what = tactic_term ; where = pattern_spec ->
         G.NTactic(loc,[G.NCases (loc, what, where)])
-    | IDENT "change"; what = pattern_spec; "with"; with_what = tactic_term -> 
+    | IDENT "change";  "with"; with_what = tactic_term; what = pattern_spec -> 
         G.NTactic(loc,[G.NChange (loc, what, with_what)])
     | SYMBOL "-"; id = IDENT ->
         G.NTactic(loc,[G.NClear (loc, [id])])
@@ -250,13 +251,8 @@ EXTEND
    [ IDENT "demod"
    | IDENT "fast_paramod"
    | IDENT "paramod"
-   | IDENT "depth"
    | IDENT "width"
    | IDENT "size"
-   | IDENT "timeout"
-   | IDENT "library"
-   | IDENT "type"
-   | IDENT "all"
    ]
 ];
   auto_params: [
@@ -522,7 +518,7 @@ EXTEND
       paramspec = OPT inverter_param_list ; 
       outsort = OPT [ SYMBOL ":" ; outsort = term -> outsort ] -> 
         G.NInverter (loc,name,indty,paramspec,outsort)
-    | LETCOREC ; defs = let_defs -> 
+    | LETCOREC ; defs = let_codefs -> 
         nmk_rec_corec `CoInductive defs loc
     | LETREC ; defs = let_defs -> 
         nmk_rec_corec `Inductive defs loc
@@ -550,12 +546,12 @@ EXTEND
         G.UnificationHint (loc, t, n)
     | IDENT "coercion"; name = IDENT;
         compose = OPT [ IDENT "nocomposites" -> () ];
-        SYMBOL ":"; ty = term; 
+        spec = OPT [ SYMBOL ":"; ty = term; 
         SYMBOL <:unicode<def>>; t = term; "on"; 
         id = [ IDENT | PIDENT ]; SYMBOL ":"; source = term;
-        "to"; target = term ->
+        "to"; target = term -> t,ty,(id,source),target ] ->
           let compose = compose = None in
-          G.NCoercion(loc,name,compose,t,ty,(id,source),target)     
+          G.NCoercion(loc,name,compose,spec)
     | IDENT "record" ; (params,name,ty,fields) = record_spec ->
         G.NObj (loc, N.Record (params,name,ty,fields))
     | IDENT "copy" ; s = IDENT; IDENT "from"; u = URI; "with";