aboutsummaryrefslogtreecommitdiff
path: root/ide/richprinter.ml
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2016-06-02 18:00:06 +0200
committerPierre-Marie Pédrot2016-06-02 18:00:30 +0200
commit71b64cc5ec5ab0d70d437ec4542c5903f43063cb (patch)
tree440fb8e51d1fe118d866d0c620a86724e3c6eae8 /ide/richprinter.ml
parent2d2d86c165cac7b051da1c5079d614a76550a20c (diff)
parent318fc2c04df1e73cc8a178d4fc1ce8bf5543649b (diff)
Move XML serialization to ide/ folder.
Diffstat (limited to 'ide/richprinter.ml')
-rw-r--r--ide/richprinter.ml24
1 files changed, 24 insertions, 0 deletions
diff --git a/ide/richprinter.ml b/ide/richprinter.ml
new file mode 100644
index 0000000000..5f39f36eab
--- /dev/null
+++ b/ide/richprinter.ml
@@ -0,0 +1,24 @@
+open Richpp
+
+module RichppConstr = Ppconstr.Richpp
+module RichppVernac = Ppvernac.Richpp
+module RichppTactic = Pptactic.Richpp
+
+type rich_pp =
+ Ppannotation.t Richpp.located Xml_datatype.gxml
+ * Xml_datatype.xml
+
+let get_annotations obj = Pp.Tag.prj obj Ppannotation.tag
+
+let make_richpp pr ast =
+ let rich_pp =
+ rich_pp get_annotations (pr ast)
+ in
+ let xml = Ppannotation.(
+ xml_of_rich_pp tag_of_annotation attributes_of_annotation rich_pp
+ )
+ in
+ (rich_pp, xml)
+
+let richpp_vernac = make_richpp RichppVernac.pr_vernac
+let richpp_constr = make_richpp RichppConstr.pr_constr_expr