diff options
author | Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr> | 2016-04-08 00:58:56 +0200 |
---|---|---|
committer | Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr> | 2016-04-08 01:44:10 +0200 |
commit | b5420538da04984ca42eb4284a9be27f3b5ba021 (patch) | |
tree | aef40fc7c5b541e47a15e62488ca617b96012f78 /lib/genarg.ml | |
parent | 1f6a31d138bcfcf341f28772de7c5e08906167c5 (diff) |
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.
Diffstat (limited to 'lib/genarg.ml')
-rw-r--r-- | lib/genarg.ml | 12 |
1 files changed, 7 insertions, 5 deletions
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 |