sig
type t = Sexplib.Type.t = Atom of string | List of t list
val default_indent : int ref
val size : t -> int * int
val scan_sexp : ?buf:Buffer.t -> Lexing.lexbuf -> t
val scan_sexps : ?buf:Buffer.t -> Lexing.lexbuf -> t list
val scan_iter_sexps :
?buf:Buffer.t -> f:(t -> unit) -> Lexing.lexbuf -> unit
val scan_fold_sexps :
?buf:Buffer.t -> f:('a -> t -> 'a) -> init:'a -> Lexing.lexbuf -> 'a
val scan_cnv_sexps :
?buf:Buffer.t -> f:(t -> 'a) -> Lexing.lexbuf -> 'a list
type parse_pos =
Sexplib.Pre_sexp.parse_pos = private {
mutable text_line : int;
mutable text_char : int;
mutable buf_pos : int;
}
type 'a parse_result =
'a Sexplib.Pre_sexp.parse_result =
Done of t * parse_pos
| Cont of bool * 'a parse_fun
and 'a parse_fun = pos:int -> len:int -> 'a -> 'a parse_result
type parse_state =
Sexplib.Pre_sexp.parse_state = private {
parse_pos : parse_pos;
mutable pstack : t list list;
pbuf : Buffer.t;
}
type parse_error =
Sexplib.Pre_sexp.parse_error = {
location : string;
err_msg : string;
parse_state : parse_state;
}
exception Parse_error of parse_error
val parse :
?text_line:int ->
?text_char:int -> ?pos:int -> ?len:int -> string -> string parse_result
type bstr =
(char, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.t
val parse_bstr :
?text_line:int ->
?text_char:int -> ?pos:int -> ?len:int -> bstr -> bstr parse_result
val input_sexp :
?text_line:int -> ?text_char:int -> ?buf_pos:int -> in_channel -> t
val input_sexps :
?text_line:int ->
?text_char:int -> ?buf_pos:int -> ?buf:string -> in_channel -> t list
val input_rev_sexps :
?text_line:int ->
?text_char:int -> ?buf_pos:int -> ?buf:string -> in_channel -> t list
val load_sexp : ?buf:string -> string -> t
val load_sexps : ?buf:string -> string -> t list
val load_rev_sexps : ?buf:string -> string -> t list
val output_hum : out_channel -> t -> unit
val output_hum_indent : int -> out_channel -> t -> unit
val output_mach : out_channel -> t -> unit
val output : out_channel -> t -> unit
val save_hum : string -> t -> unit
val save_mach : string -> t -> unit
val save : string -> t -> unit
val save_sexps : string -> t list -> unit
val pp_hum : Format.formatter -> t -> unit
val pp_hum_indent : int -> Format.formatter -> t -> unit
val pp_mach : Format.formatter -> t -> unit
val pp : Format.formatter -> t -> unit
val of_string : string -> t
val of_bstr : bstr -> t
val to_string_hum : ?indent:int -> t -> string
val to_string_mach : t -> string
val to_string : t -> string
val to_buffer_hum : buf:Buffer.t -> ?indent:int -> t -> unit
val to_buffer_mach : buf:Buffer.t -> t -> unit
val to_buffer : buf:Buffer.t -> t -> unit
val unit : t
external sexp_of_t : t -> t = "%identity"
external t_of_sexp : t -> t = "%identity"
type found = [ `Found | `Pos of int * found ]
type search_result = [ `Found | `Not_found | `Pos of int * found ]
val search_physical : t -> contained:t -> search_result
val subst_found : t -> subst:t -> found -> t
type sexpable = t
val sexp_of_t : sexpable -> Sexplib.Sexp.t
val t_of_sexp : Sexplib.Sexp.t -> sexpable
type binable = t
val bin_size_t : binable Bin_prot.Size.sizer
val bin_write_t : binable Bin_prot.Map_to_safe.writer
val bin_write_t_ : binable Bin_prot.Unsafe_write_c.writer
val bin_read_t : binable Bin_prot.Read_ml.reader
val bin_read_t_ : binable Bin_prot.Unsafe_read_c.reader
val bin_read_t__ : (int -> binable) Bin_prot.Unsafe_read_c.reader
end