| Inductive of (string * Ast.term) list *
Ast.term inductive_type list
(** parameters, list of loc * mutual inductive types *)
- | Theorem of thm_flavour * string * Ast.term *
- Ast.term option
+ | Theorem of thm_flavour * string * Ast.term * Ast.term option
(** flavour, name, type, body
* - name is absent when an unnamed theorem is being proved, tipically in
* interactive usage
(string * Ast.term) list
(** left parameters, name, type, fields *)
+type metadata =
+ | Dependency of string (* baseuri without trailing slash *)
+ | Baseuri of string
+
+let compare_metadata = Pervasives.compare
+
+let eq_metadata = (=)
+
(** To be increased each time the command type below changes, used for "safe"
* marshalling *)
-let magic = 1
+let magic = 2
type ('term,'obj) command =
| Default of loc * string * UriManager.uri list
Ast.cic_appl_pattern
(* description (i.e. id), symbol, arg pattern, appl pattern *)
+ | Metadata of loc * metadata
+
(* DEBUGGING *)
| Dump of loc (* dump grammar on stdout *)
(* DEBUGGING *)
| Some `LeftToRight -> "> "
| Some `RightToLeft -> "< "
+let pp_metadata =
+ function
+ | Dependency buri -> sprintf "dependency %s" buri
+ | Baseuri buri -> sprintf "baseuri %s" buri
+
let pp_command = function
| Include (_,path) -> "include " ^ path
| Qed _ -> "qed"
(pp_associativity assoc)
(pp_precedence prec)
(pp_l2_pattern l2_pattern)
+ | Metadata (_, m) -> sprintf "metadata %s" (pp_metadata m)
| Render _
| Dump _ -> assert false (* ZACK: debugging *)
| Render _
| Dump _
| Interpretation _
+ | Metadata _
| Notation _
| Obj _ -> assert false (* not implemented *)
val pp_obj: GrafiteAst.obj -> string
val pp_command: (CicNotationPt.term,GrafiteAst.obj) GrafiteAst.command -> string
+val pp_metadata: GrafiteAst.metadata -> string
val pp_macro: ('a -> string) -> 'a GrafiteAst.macro -> string
val pp_comment:
| IDENT "interpretation"; id = QSTRING;
(symbol, args, l3) = interpretation ->
GrafiteAst.Interpretation (loc, id, (symbol, args), l3)
+ | 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"))
| IDENT "dump" -> GrafiteAst.Dump loc
| IDENT "render"; u = URI ->