IStdlib.Pp
Pretty Printing
type colormap = Stdlib.Obj.t -> color
map subexpressions (as Obj.t element compared by physical equality) to colors
val compare_print_kind : print_kind -> print_kind -> int
val equal_print_kind : print_kind -> print_kind -> bool
type env = {
opt : simple_kind;
Current option for simple printing
*)kind : print_kind;
Current kind of printing
*)break_lines : bool;
whether to let Format add its own line breaks or not (false by default)
*)cmap_norm : colormap;
Current colormap for the normal part
*)cmap_foot : colormap;
Current colormap for the footprint part
*)color : color;
Current color
*)obj_sub : (Stdlib.Obj.t -> Stdlib.Obj.t) option;
generic object substitution
*)}
Print environment threaded through all the printing functions
Set the object substitution, which is supposed to preserve the type. Currently only used for a map from (identifier) expressions to the program var containing them
Extend the normal colormap for the given object with the given color
val text : env
Default text print environment
val text_break : env
text print environment that allows line breaks
val color_string : color -> string
string representation of colors
val escape_xml :
(F.formatter -> 'a -> unit) ->
print_kind ->
F.formatter ->
'a ->
unit
escapes the output of the pretty printer parameter using HTML codes
val with_color :
print_kind ->
color ->
(F.formatter -> 'a -> unit) ->
F.formatter ->
'a ->
unit
val html_with_color :
color ->
(F.formatter -> 'a -> unit) ->
F.formatter ->
'a ->
unit
val html_collapsible_block :
name:string ->
print_kind ->
(F.formatter -> 'a -> unit) ->
F.formatter ->
'a ->
unit
Output the value in a named summary-details block. Both the name and the result of inner pretty-printer will be escaped.
pretty print command line arguments, expanding argument files to print their contents
pretty print command line arguments, and expand argument files if verbose
is true
val seq :
?print_env:env ->
?sep:string ->
?sep_html:string ->
(F.formatter -> 'a -> unit) ->
F.formatter ->
'a list ->
unit
Pretty print a sequence with sep
followed by a space between each element. By default, print_env
is text
, sep
is "", and sep_html
set to sep
.
val comma_seq :
?print_env:env ->
(F.formatter -> 'a -> unit) ->
F.formatter ->
'a list ->
unit
Pretty print a comma-separated sequence.
val comma_seq_diff :
(F.formatter -> 'a -> unit) ->
env ->
F.formatter ->
'a list ->
unit
val semicolon_seq :
?print_env:env ->
(F.formatter -> 'a -> unit) ->
F.formatter ->
'a list ->
unit
Pretty print a ;-separated sequence
If all you have is to_string, but you need pp_foo.
If all you have is pp_foo, but you need to_string.
val collection :
fold:('t, 'item, bool) IStdlib.IStd.Container.fold ->
sep:(unit, F.formatter, unit) IStd.format ->
?filter:('item -> bool) ->
(F.formatter -> 'item -> unit) ->
F.formatter ->
't ->
unit