From b5420538da04984ca42eb4284a9be27f3b5ba021 Mon Sep 17 00:00:00 2001 From: Pierre-Marie Pédrot Date: Fri, 8 Apr 2016 00:58:56 +0200 Subject: Fixing printing of toplevel values. This is not perfect yet, in particular the whole precedence system is a real mess, as there is a real need for tidying up the Pptactic implementation. Nonetheless, printing toplevel values is only used for debugging purposes, where an ugly display is better than none at all. --- lib/genarg.ml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'lib/genarg.ml') diff --git a/lib/genarg.ml b/lib/genarg.ml index 5d5b29c99..ef0de89af 100644 --- a/lib/genarg.ml +++ b/lib/genarg.ml @@ -61,11 +61,13 @@ struct end | _ -> None - let rec repr : type a. a tag -> std_ppcmds = function - | Base t -> str (ValT.repr t) - | List t -> repr t ++ spc () ++ str "list" - | Opt t -> repr t ++ spc () ++ str "option" - | Pair (t1, t2) -> str "(" ++ repr t1 ++ str " * " ++ repr t2 ++ str ")" + let repr = ValT.repr + + let rec pr : type a. a tag -> std_ppcmds = function + | Base t -> str (repr t) + | List t -> pr t ++ spc () ++ str "list" + | Opt t -> pr t ++ spc () ++ str "option" + | Pair (t1, t2) -> str "(" ++ pr t1 ++ str " * " ++ pr t2 ++ str ")" end -- cgit v1.2.3