/usr/lib/ocaml/atd/atd_indent.mli is in libatd-ocaml-dev 1.1.1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | (**
Simple indentation utility for code generators
*)
type t =
[
| `Line of string
| `Block of t list
| `Inline of t list
]
(**
[t] is the type of the data to be printed.
- [`Line]: single line (not indented)
- [`Block]: indented sequence
- [`Inline]: in-line sequence (not indented)
Example:
{v
let l =
[
`Line "d";
`Line "e";
]
in
[
`Line "a";
`Block [
`Line "b";
`Line "c";
];
`Inline l;
`Line "f";
]
v}
gives:
{v
a
b
c
d
e
f
v}
*)
val to_buffer : ?offset:int -> ?indent:int -> Buffer.t -> t list -> unit
(** Write to a buffer.
@param offset defines the number of space characters
to use for the left margin. Default: 0.
@param indent defines the number of space characters to use for
indenting blocks. Default: 2.
*)
val to_string : ?offset:int -> ?indent:int -> t list -> string
(** Write to a string. See [to_buffer] for the options. *)
val to_channel : ?offset:int -> ?indent:int -> out_channel -> t list -> unit
(** Write to a channel. See [to_buffer] for the options. *)
val to_stdout : ?offset:int -> ?indent:int -> t list -> unit
(** Write to [stdout]. See [to_buffer] for the options. *)
|