summaryrefslogtreecommitdiff
path: root/src/pretty_print.ml
diff options
context:
space:
mode:
authorGabriel Kerneis2014-05-15 12:39:39 +0100
committerGabriel Kerneis2014-05-15 12:39:39 +0100
commitf093aa8719cebbf17e7cbd279fa83376ef9b0bfb (patch)
treebdb9dc361d7fac8612add17bf60ac86e13d7d55b /src/pretty_print.ml
parent2bd31cabc743143353bc0bd00b05bc3525bc01e0 (diff)
Testing pretty-printer
It does not work - infinite loop somewhere probably when trying to handle precedence.
Diffstat (limited to 'src/pretty_print.ml')
-rw-r--r--src/pretty_print.ml6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/pretty_print.ml b/src/pretty_print.ml
index 0ade4ff7..c3eb6be2 100644
--- a/src/pretty_print.ml
+++ b/src/pretty_print.ml
@@ -1251,3 +1251,9 @@ let doc_def = function
let doc_defs (Defs(defs)) =
separate_map hardline doc_def defs
+
+let print ?(len=80) formatter doc =
+ ToFormatter.pretty 1.0 len formatter doc
+
+let pp_defs f d = print f (doc_defs d)
+let pp_exp f e = print f (doc_exp e)