sig
module Rel_pos :
sig
type t = Src_pos.Relative.t = { row : int; col : int; }
val sexp_of_t : t -> Type.t
val zero : t
val add : t -> t -> t
val sub : t -> t -> t
end
module Abs_pos :
sig
type t = Src_pos.Absolute.t = { row : int; col : int; }
val sexp_of_t : t -> Type.t
val origin : t
val of_lexing : Lexing.position -> t
val diff : t -> t -> Src_pos.Relative.t
val add : t -> Src_pos.Relative.t -> t
val sub : t -> Src_pos.Relative.t -> t
val geq : t -> t -> bool
end
type last_atom = {
immed_after : Sexp_with_layout.Render.Abs_pos.t;
unescaped : bool;
}
type state = {
mutable row_shift : Sexp_with_layout.Render.Rel_pos.t;
mutable current : Sexp_with_layout.Render.Abs_pos.t;
mutable last_atom : Sexp_with_layout.Render.last_atom option;
}
type 'a t = (char -> unit) -> Sexp_with_layout.Render.state -> 'a
val return : 'a -> 'b -> 'c -> 'a
val bind : ('a -> 'b -> 'c) -> ('c -> 'a -> 'b -> 'd) -> 'a -> 'b -> 'd
val run : 'a -> ('a -> Sexp_with_layout.Render.state -> 'b) -> 'b
val emit_char :
(char -> 'a) -> Sexp_with_layout.Render.state -> char -> unit
val emit_string :
(char -> 'a) -> Sexp_with_layout.Render.state -> string -> unit
val emit_chars :
(char -> 'a) -> Sexp_with_layout.Render.state -> char -> n:int -> unit
val advance :
(char -> 'a) ->
anchor:Sexp_with_layout.Render.Abs_pos.t ->
Sexp_with_layout.Render.state ->
by:Src_pos.Relative.t -> unescaped_atom:bool -> unit
val render_t :
(char -> 'a) ->
anchor:Sexp_with_layout.Render.Abs_pos.t ->
Sexp_with_layout.Render.state -> Sexp_with_layout.Render.t -> unit
val render_toc :
(char -> 'a) ->
anchor:Sexp_with_layout.Render.Abs_pos.t ->
Sexp_with_layout.Render.state -> t_or_comment -> unit
val render_c :
(char -> 'a) ->
anchor:Sexp_with_layout.Render.Abs_pos.t ->
Sexp_with_layout.Render.state -> comment -> unit
val render :
t_or_comment -> (char -> 'a) -> Sexp_with_layout.Render.state -> unit
val sexp :
t_or_comment -> (char -> 'a) -> Sexp_with_layout.Render.state -> unit
end