]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/grafite_parser/grafiteParser.ml
Procedural: some improvements
[helm.git] / helm / software / components / grafite_parser / grafiteParser.ml
index fb0128edb0ceb63c423c53832d4eedb1681dd24a..1321f613b82e91a5acc8e793d14c76d49f687624 100644 (file)
@@ -35,7 +35,8 @@ type 'a localized_option =
 
 type ast_statement =
   (CicNotationPt.term, CicNotationPt.term,
-   CicNotationPt.term GrafiteAst.reduction, CicNotationPt.obj, string)
+   CicNotationPt.term GrafiteAst.reduction, 
+   CicNotationPt.term CicNotationPt.obj, string)
     GrafiteAst.statement
 
 type statement =
@@ -116,7 +117,9 @@ EXTEND
   ];
   int: [ [ num = NUMBER -> int_of_string num ] ];
   intros_spec: [
-    [ num = OPT [ num = int -> num ]; idents = OPT ident_list0 ->
+    [ OPT [ IDENT "names" ]; 
+      num = OPT [ num = int -> num ]; 
+      idents = OPT ident_list0 ->
         let idents = match idents with None -> [] | Some idents -> idents in
         num, idents
     ]
@@ -411,9 +414,15 @@ EXTEND
   macro: [
     [ [ IDENT "check"   ]; t = term ->
         GrafiteAst.Check (loc, t)
-    | [ IDENT "inline"]; suri = QSTRING; prefix = OPT QSTRING ->
-         let prefix = match prefix with None -> "" | Some prefix -> prefix in
-        GrafiteAst.Inline (loc,suri,prefix)
+    | [ IDENT "inline"]; 
+        style = OPT [ IDENT "procedural" ];
+       suri = QSTRING; prefix = OPT QSTRING ->
+         let style = match style with 
+           | None   -> GrafiteAst.Declarative
+           | Some _ -> GrafiteAst.Procedural
+        in
+        let prefix = match prefix with None -> "" | Some prefix -> prefix in
+        GrafiteAst.Inline (loc,style,suri,prefix)
     | [ IDENT "hint" ] -> GrafiteAst.Hint loc
     | [ IDENT "whelp"; "match" ] ; t = term -> 
         GrafiteAst.WMatch (loc,t)