| flavour = theorem_flavour; name = IDENT; SYMBOL ":"; typ = term;
body = OPT [ SYMBOL <:unicode<def>> (* ≝ *); body = term -> body ] ->
GrafiteAst.Obj (loc,GrafiteAst.Theorem (flavour, name, typ, body))
- | flavour = theorem_flavour; name = IDENT;
- body = OPT [ SYMBOL <:unicode<def>> (* ≝ *); body = term -> body ] ->
+ | flavour = theorem_flavour; name = IDENT; SYMBOL <:unicode<def>> (* ≝ *);
+ body = term ->
GrafiteAst.Obj (loc,
- GrafiteAst.Theorem (flavour, name, Ast.Implicit, body))
+ GrafiteAst.Theorem (flavour, name, Ast.Implicit, Some body))
| "let"; ind_kind = [ "corec" -> `CoInductive | "rec"-> `Inductive ];
defs = CicNotationParser.let_defs ->
let name,ty =
let body = Ast.Ident (name,None) in
GrafiteAst.Obj (loc,GrafiteAst.Theorem(`Definition, name, ty,
Some (Ast.LetRec (ind_kind, defs, body))))
- | [ IDENT "inductive" ]; spec = inductive_spec ->
+ | IDENT "inductive"; spec = inductive_spec ->
let (params, ind_types) = spec in
GrafiteAst.Obj (loc,GrafiteAst.Inductive (params, ind_types))
- | [ IDENT "coinductive" ]; spec = inductive_spec ->
+ | IDENT "coinductive"; spec = inductive_spec ->
let (params, ind_types) = spec in
let ind_types = (* set inductive flags to false (coinductive) *)
List.map (fun (name, _, term, ctors) -> (name, false, term, ctors))
| IDENT "interpretation"; id = QSTRING;
(symbol, args, l3) = interpretation ->
GrafiteAst.Interpretation (loc, id, (symbol, args), l3)
- | IDENT "metadata"; [IDENT "dependency" | IDENT "baseuri" ] ; URI ->
+ | IDENT "metadata"; [ IDENT "dependency" | IDENT "baseuri" ] ; URI ->
(** metadata commands lives only in .moo, where they are in marshalled
* form *)
raise (CicNotationParser.Parse_error (loc, "metadata not allowed here"))