aboutsummaryrefslogtreecommitdiff
path: root/lib/ppstyle.ml
diff options
context:
space:
mode:
authorEmilio Jesus Gallego Arias2016-12-05 18:17:46 +0100
committerEmilio Jesus Gallego Arias2017-03-21 15:51:38 +0100
commita8ec2dc5c330ded1ba400ef202c57e68d2533312 (patch)
treef333e6c9367c51f7a3c208413d3fb607916a724e /lib/ppstyle.ml
parent6885a398229918865378ea24f07d93d2bcdd2802 (diff)
[pp] Remove special tag type and handler from Pp.
For legacy reasons, pretty printing required to provide a "tag" interpretation function `pp_tag`. However such function was not of much use as the backends (richpp and terminal) hooked at the `Format.tag` level. We thus remove this unused indirection layer and annotate expressions with their `Format` tags. This is a step towards moving the last bit of terminal code out of the core system.
Diffstat (limited to 'lib/ppstyle.ml')
-rw-r--r--lib/ppstyle.ml13
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/ppstyle.ml b/lib/ppstyle.ml
index 298e3be6b3..6969c3d5cb 100644
--- a/lib/ppstyle.ml
+++ b/lib/ppstyle.ml
@@ -19,27 +19,20 @@ let make ?style tag =
let name = to_format tag in
let () = assert (not (String.Map.mem name !tags)) in
let () = tags := String.Map.add name style !tags in
- tag
-
-let repr t = t
+ name
let get_style tag =
- try String.Map.find (to_format tag) !tags
- with Not_found -> assert false
-
-let get_style_format tag =
try String.Map.find tag !tags
with Not_found -> assert false
let set_style tag st =
- try tags := String.Map.update (to_format tag) st !tags
+ try tags := String.Map.update tag st !tags
with Not_found -> assert false
let clear_styles () =
tags := String.Map.map (fun _ -> None) !tags
-let dump () =
- List.map (fun (s,b) -> (String.split '.' s, b)) (String.Map.bindings !tags)
+let dump () = String.Map.bindings !tags
let parse_config s =
let styles = Terminal.parse s in