sig
val bin_size_t : Sexplib.Sexp.t Bin_prot.Size.sizer
val bin_write_t : Sexplib.Sexp.t Bin_prot.Map_to_safe.writer
val bin_write_t_ : Sexplib.Sexp.t Bin_prot.Unsafe_write_c.writer
val bin_read_t : Sexplib.Sexp.t Bin_prot.Read_ml.reader
val bin_read_t_ : Sexplib.Sexp.t Bin_prot.Unsafe_read_c.reader
val bin_read_t__ : (int -> Sexplib.Sexp.t) Bin_prot.Unsafe_read_c.reader
val bin_writer_t : Sexplib.Sexp.t Bin_prot.Type_class.writer
val bin_reader_t : Sexplib.Sexp.t Bin_prot.Type_class.reader
val bin_t : Sexplib.Sexp.t Bin_prot.Type_class.t
type t = Sexplib.Type.t = Atom of string | List of t list
type bigstring =
(char, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.t
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_rev_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_sexps_conv :
?buf:Buffer.t -> f:(t -> 'a) -> Lexing.lexbuf -> 'a list
module Parse_pos :
sig
type t =
Sexplib.Pre_sexp.Parse_pos.t = private {
mutable text_line : int;
mutable text_char : int;
mutable global_offset : int;
mutable buf_pos : int;
}
val create :
?text_line:int ->
?text_char:int -> ?buf_pos:int -> ?global_offset:int -> unit -> t
val with_buf_pos : t -> int -> t
end
module Cont_state :
sig
type t =
Sexplib.Pre_sexp.Cont_state.t =
Parsing_whitespace
| Parsing_atom
| Parsing_list
| Parsing_sexp_comment
| Parsing_block_comment
val to_string : t -> string
end
type ('a, 't) parse_result =
('a, 't) Sexplib.Pre_sexp.parse_result =
Done of 't * Parse_pos.t
| Cont of Cont_state.t * ('a, 't) parse_fun
and ('a, 't) parse_fun = pos:int -> len:int -> 'a -> ('a, 't) parse_result
module Annotated :
sig
type pos =
Sexplib.Pre_sexp.Annotated.pos = {
line : int;
col : int;
offset : int;
}
type range =
Sexplib.Pre_sexp.Annotated.range = {
start_pos : pos;
end_pos : pos;
}
type t =
Sexplib.Pre_sexp.Annotated.t =
Atom of range * Sexplib.Type.t
| List of range * t list * Sexplib.Type.t
type 'a conv = [ `Error of exn * t | `Result of 'a ]
exception Conv_exn of string * exn
type stack =
Sexplib.Pre_sexp.Annotated.stack = {
mutable positions : pos list;
mutable stack : t list list;
}
val get_sexp : t -> Sexplib.Type.t
val get_range : t -> range
val find_sexp : t -> Sexplib.Type.t -> t option
val parse :
?parse_pos:Parse_pos.t ->
?len:int -> string -> (string, t) parse_result
val parse_bigstring :
?parse_pos:Parse_pos.t ->
?len:int -> bigstring -> (bigstring, t) parse_result
val input_sexp : ?parse_pos:Parse_pos.t -> in_channel -> t
val input_sexps :
?parse_pos:Parse_pos.t -> ?buf:string -> in_channel -> t list
val input_rev_sexps :
?parse_pos:Parse_pos.t -> ?buf:string -> in_channel -> t list
val load_sexp : ?strict:bool -> ?buf:string -> string -> t
val load_sexps : ?buf:string -> string -> t list
val load_rev_sexps : ?buf:string -> string -> t list
val of_string : string -> t
val of_bigstring : bigstring -> t
val conv : (Sexplib.Type.t -> 'a) -> t -> 'a conv
val get_conv_exn : file:string -> exc:exn -> t -> exn
end
type 't parse_state =
't Sexplib.Pre_sexp.parse_state = private {
parse_pos : Parse_pos.t;
mutable pstack : 't;
pbuf : Buffer.t;
}
type parse_error =
Sexplib.Pre_sexp.parse_error = {
location : string;
err_msg : string;
parse_state :
[ `Annot of Annotated.stack parse_state
| `Sexp of t list list parse_state ];
}
exception Parse_error of parse_error
val parse :
?parse_pos:Parse_pos.t -> ?len:int -> string -> (string, t) parse_result
val parse_bigstring :
?parse_pos:Parse_pos.t ->
?len:int -> bigstring -> (bigstring, t) parse_result
val input_sexp : ?parse_pos:Parse_pos.t -> in_channel -> t
val input_sexps :
?parse_pos:Parse_pos.t -> ?buf:string -> in_channel -> t list
val input_rev_sexps :
?parse_pos:Parse_pos.t -> ?buf:string -> in_channel -> t list
val load_sexp : ?strict:bool -> ?buf:string -> string -> t
val load_sexps : ?buf:string -> string -> t list
val load_rev_sexps : ?buf:string -> string -> t list
val load_sexp_conv :
?strict:bool -> ?buf:string -> string -> (t -> 'a) -> 'a Annotated.conv
val load_sexp_conv_exn :
?strict:bool -> ?buf:string -> string -> (t -> 'a) -> 'a
val load_sexps_conv :
?buf:string -> string -> (t -> 'a) -> 'a Annotated.conv list
val load_sexps_conv_exn : ?buf:string -> string -> (t -> 'a) -> 'a 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 : ?perm:int -> string -> t -> unit
val save_mach : ?perm:int -> string -> t -> unit
val save : ?perm:int -> string -> t -> unit
val save_sexps_hum : ?perm:int -> string -> t list -> unit
val save_sexps_mach : ?perm:int -> string -> t list -> unit
val save_sexps : ?perm:int -> 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
module Of_string_conv_exn :
sig
type t =
Sexp.Of_string_conv_exn.t = {
exc : exn;
sexp : Sexplib.Type.t;
sub_sexp : Sexplib.Type.t;
}
exception E of t
end
val of_string : string -> t
val of_string_conv : string -> (t -> 'a) -> 'a Annotated.conv
val of_string_conv_exn : string -> (t -> 'a) -> 'a
val of_bigstring : bigstring -> t
val of_bigstring_conv : bigstring -> (t -> 'a) -> 'a Annotated.conv
val of_bigstring_conv_exn : bigstring -> (t -> 'a) -> 'a
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 to_buffer_gen :
buf:'buffer ->
add_char:('buffer -> char -> unit) ->
add_string:('buffer -> string -> unit) -> 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
val of_int_style : [ `No_underscores | `Underscores ] ref
type 'a no_raise = 'a
val sexp_of_no_raise :
('a -> Sexplib.Sexp.t) -> 'a no_raise -> Sexplib.Sexp.t
val no_raise_of_sexp :
(Sexplib.Sexp.t -> 'a) -> Sexplib.Sexp.t -> 'a no_raise
val bin_size_no_raise :
'a Bin_prot.Size.sizer -> 'a no_raise Bin_prot.Size.sizer
val bin_write_no_raise :
'a Bin_prot.Unsafe_write_c.writer -> 'a no_raise Bin_prot.Write_ml.writer
val bin_write_no_raise_ :
'a Bin_prot.Unsafe_write_c.writer ->
'a no_raise Bin_prot.Unsafe_write_c.writer
val bin_writer_no_raise :
'a Bin_prot.Type_class.writer -> 'a no_raise Bin_prot.Type_class.writer
val bin_read_no_raise :
'a Bin_prot.Unsafe_read_c.reader -> 'a no_raise Bin_prot.Read_ml.reader
val bin_read_no_raise_ :
'a Bin_prot.Unsafe_read_c.reader ->
'a no_raise Bin_prot.Unsafe_read_c.reader
val bin_read_no_raise__ :
'a Bin_prot.Unsafe_read_c.reader ->
(int -> 'a no_raise) Bin_prot.Unsafe_read_c.reader
val bin_reader_no_raise :
'a Bin_prot.Type_class.reader -> 'a no_raise Bin_prot.Type_class.reader
val bin_no_raise :
'a Bin_prot.Type_class.t -> 'a no_raise Bin_prot.Type_class.t
module Sexp_option :
sig
val bin_size_sexp_option : ('a, 'a option) Bin_prot.Size.sizer1
val bin_write_sexp_option :
('a, 'a option) Bin_prot.Map_to_safe.writer1
val bin_write_sexp_option_ :
('a, 'a option) Bin_prot.Unsafe_write_c.writer1
val bin_read_sexp_option : ('a, 'a option) Bin_prot.Map_to_safe.reader1
val bin_read_sexp_option_ :
('a, 'a option) Bin_prot.Unsafe_read_c.reader1
val bin_read_sexp_option__ :
('a, int -> 'a option) Bin_prot.Unsafe_read_c.reader1
val bin_writer_sexp_option :
('a, 'a option) Bin_prot.Type_class.S1.writer
val bin_reader_sexp_option :
('a, 'a option) Bin_prot.Type_class.S1.reader
val bin_sexp_option : ('a, 'a option) Bin_prot.Type_class.S1.t
end
module Sexp_list :
sig
val bin_size_sexp_list : ('a, 'a list) Bin_prot.Size.sizer1
val bin_write_sexp_list : ('a, 'a list) Bin_prot.Map_to_safe.writer1
val bin_write_sexp_list_ :
('a, 'a list) Bin_prot.Unsafe_write_c.writer1
val bin_read_sexp_list : ('a, 'a list) Bin_prot.Map_to_safe.reader1
val bin_read_sexp_list_ : ('a, 'a list) Bin_prot.Unsafe_read_c.reader1
val bin_read_sexp_list__ :
('a, int -> 'a list) Bin_prot.Unsafe_read_c.reader1
val bin_writer_sexp_list : ('a, 'a list) Bin_prot.Type_class.S1.writer
val bin_reader_sexp_list : ('a, 'a list) Bin_prot.Type_class.S1.reader
val bin_sexp_list : ('a, 'a list) Bin_prot.Type_class.S1.t
end
module Sexp_array :
sig
val bin_size_sexp_array : ('a, 'a array) Bin_prot.Size.sizer1
val bin_write_sexp_array : ('a, 'a array) Bin_prot.Map_to_safe.writer1
val bin_write_sexp_array_ :
('a, 'a array) Bin_prot.Unsafe_write_c.writer1
val bin_read_sexp_array : ('a, 'a array) Bin_prot.Map_to_safe.reader1
val bin_read_sexp_array_ :
('a, 'a array) Bin_prot.Unsafe_read_c.reader1
val bin_read_sexp_array__ :
('a, int -> 'a array) Bin_prot.Unsafe_read_c.reader1
val bin_writer_sexp_array :
('a, 'a array) Bin_prot.Type_class.S1.writer
val bin_reader_sexp_array :
('a, 'a array) Bin_prot.Type_class.S1.reader
val bin_sexp_array : ('a, 'a array) Bin_prot.Type_class.S1.t
end
module Sexp_opaque :
sig
val bin_size_sexp_opaque : ('a, 'a) Bin_prot.Size.sizer1
val bin_write_sexp_opaque : ('a, 'a) Bin_prot.Map_to_safe.writer1
val bin_write_sexp_opaque_ : ('a, 'a) Bin_prot.Unsafe_write_c.writer1
val bin_read_sexp_opaque : ('a, 'a) Bin_prot.Map_to_safe.reader1
val bin_read_sexp_opaque_ : ('a, 'a) Bin_prot.Unsafe_read_c.reader1
val bin_read_sexp_opaque__ :
('a, int -> 'a) Bin_prot.Unsafe_read_c.reader1
val bin_writer_sexp_opaque : ('a, 'a) Bin_prot.Type_class.S1.writer
val bin_reader_sexp_opaque : ('a, 'a) Bin_prot.Type_class.S1.reader
val bin_sexp_opaque : ('a, 'a) Bin_prot.Type_class.S1.t
end
module Sexp_maybe :
sig
type 'a t = ('a, Sexplib.Sexp.t) Result.t
val sexp_of_t : ('a -> Sexplib.Sexp.t) -> 'a t -> Sexplib.Sexp.t
val t_of_sexp : (Sexplib.Sexp.t -> 'a) -> Sexplib.Sexp.t -> 'a t
val bin_size_t : ('a, 'a t) Bin_prot.Size.sizer1
val bin_write_t : ('a, 'a t) Bin_prot.Map_to_safe.writer1
val bin_write_t_ : ('a, 'a t) Bin_prot.Unsafe_write_c.writer1
val bin_read_t : ('a, 'a t) Bin_prot.Map_to_safe.reader1
val bin_read_t_ : ('a, 'a t) Bin_prot.Unsafe_read_c.reader1
val bin_read_t__ : ('a, int -> 'a t) Bin_prot.Unsafe_read_c.reader1
val bin_writer_t : ('a, 'a t) Bin_prot.Type_class.S1.writer
val bin_reader_t : ('a, 'a t) Bin_prot.Type_class.S1.reader
val bin_t : ('a, 'a t) Bin_prot.Type_class.S1.t
end
val ounit_tests : unit -> OUnit.test
end