package ocp-indent
Install
Dune Dependency
Authors
Maintainers
Sources
md5=d4d11e1aaedd7d3268ac7d5813de43ca
sha512=246a97f04b44371900a6f39eab34d9b674d6afa9026e78fce2ef171b5d28fcca0b49f353b2de9d09cb5529b896e47c253acc3074618060862e8a7debd9289afc
doc/ocp-indent.lib/IndentPrinter/index.html
Module IndentPrinter
Source
Passed to the function specified with the Extended
output_kind
type 'a output_kind =
| Numeric of int -> 'a -> 'a
| Print of string -> 'a -> 'a
| Extended of IndentBlock.t -> output_elt -> 'a -> 'a
* If Print f
, the whole input is fed as strings through f, with expected lines reindented (with spaces). * If Numeric f
, the indentation values (i.e. total number of leading spaces) for each lines on which in_lines
is true are passed through the function. * If Extended f
, every element is fed to f
with arguments state element
. There is at least an element for each token, but there may be more (whitespace, multiline tokens...). You may safely raise an exception from f
to stop further processing. This version can be used for syntax highlighting or storing checkpoints.
type 'a output = {
debug : bool;
config : IndentConfig.t;
(*Returns true on the lines that should be reindented (lines start at 1)
*)in_lines : int -> bool;
(*if true, partial indent will adapt to the current indent of the file
*)adaptive : bool;
indent_empty : bool;
kind : 'a output_kind;
}