module Atd_indent:Simple indentation utility for code generatorssig..end
typet =[ `Block of t list
| `Inline of t list
| `Line of string ]
t is the type of the data to be printed.
`Line: single line (not indented)`Block: indented sequence`Inline: in-line sequence (not indented)
let l =
[
`Line "d";
`Line "e";
]
in
[
`Line "a";
`Block [
`Line "b";
`Line "c";
];
`Inline l;
`Line "f";
]
gives:
a b c d e f
val to_buffer : ?offset:int -> ?indent:int -> Buffer.t -> t list -> unitoffset : defines the number of space characters
to use for the left margin. Default: 0.indent : defines the number of space characters to use for
indenting blocks. Default: 2.val to_string : ?offset:int -> ?indent:int -> t list -> stringto_buffer for the options.val to_channel : ?offset:int ->
?indent:int -> Pervasives.out_channel -> t list -> unitto_buffer for the options.val to_stdout : ?offset:int -> ?indent:int -> t list -> unitstdout. See to_buffer for the options.