123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191openBasementmoduleDefinitions=structtypet=Sexp_type.Sexp.t=|Atomofstring|ListoftlistmoduletypePretty_print_to_formatter=sig@@portable(** [pp_hum ppf sexp] outputs S-expression [sexp] to formatter [ppf] in human readable
form. *)valpp_hum:Format.formatter->t->unit(** [pp_hum_indent n ppf sexp] outputs S-expression [sexp] to formatter [ppf] in human
readable form and indentation level [n]. *)valpp_hum_indent:int->Format.formatter->t->unit(** [pp_mach ppf sexp] outputs S-expression [sexp] to formatter [ppf] in machine
readable (i.e. most compact) form. *)valpp_mach:Format.formatter->t->unit(** Same as [pp_mach]. *)valpp:Format.formatter->t->unitendmoduletypePretty_printing_helpers_private=sig@@portable(** Functions used by [Make_pretty_printing] *)valmach_maybe_esc_str:string->stringvalmust_escape:string->boolvalesc_str:string->stringendmoduletypePretty_printing_helpers=sig@@portableincludePretty_print_to_formatter(** @inline *)includePretty_printing_helpers_private(** @inline *)endmoduletypePretty_printing=sig@@portable(*_ In [Base], this is replaced with [String.Utf8.t] *)typeoutput(** {1 Printing to formatters} *)includePretty_print_to_formatter(** @inline *)(** {1 Conversion to strings} *)(** [to_string_hum ?indent ?max_width sexp] converts S-expression [sexp] to a string
in human readable form with indentation level [indent] and target maximum width
[max_width]. Note long atoms may overflow [max_width].
@param indent default = [Dynamic.get default_indent]
@param max_width default = [78] *)valto_string_hum:?indent:int->?max_width:int->t->output(** [to_string_mach sexp] converts S-expression [sexp] to a string in machine readable
(i.e. most compact) form. *)valto_string_mach:t->output(** Same as [to_string_mach]. *)valto_string:t->output(** {1 Conversion to buffers} *)(** [to_buffer_hum ~buf ?indent ?max_width sexp] outputs the S-expression [sexp]
converted to a string in human readable form to buffer [buf] with indentation
level [indent] and target maximum width [max_width]. Note long atoms may overflow
[max_width].
@param indent default = [Dynamic.get default_indent]
@param max_width default = [78] *)valto_buffer_hum:buf:Buffer.t->?indent:int->?max_width:int->t->unit(** [to_buffer_mach ~buf sexp] outputs the S-expression [sexp] converted to a string
in machine readable (i.e. most compact) form to buffer [buf]. *)valto_buffer_mach:buf:Buffer.t->t->unit(** [to_buffer ~buf sexp] same as {!to_buffer_mach}. *)valto_buffer:buf:Buffer.t->t->unit(** [to_buffer_gen ~buf ~add_char ~add_string sexp] outputs the S-expression [sexp]
converted to a string to buffer [buf] using the output functions [add_char] and
[add_string]. *)valto_buffer_gen:buf:'buffer->add_char:('buffer->char->unit)->add_string:('buffer->string->unit)->t->unit(*_ See the Jane Street Style Guide for an explanation of [Private] submodules:
https://opensource.janestreet.com/standards/#private-submodules *)modulePretty_printing_helpers_private:Pretty_printing_helpers_privateendendmoduletypeSexp=sig@@portable(*_ NOTE: We do not use the [include module type of struct] pattern here as it messes
with the compiler's short-names heuristics. This should be okay since [Definitions]
isn't exported from this library. *)includemoduletypeofDefinitions(*_ We don't use [@@deriving sexp] as this would generated references to [Sexplib],
creating a circular dependency *)valt_of_sexp:t->tvalsexp_of_t:t->tvalsexp_of_t__stack:local_t->local_tvalequal:t->t->boolvalcompare:t->t->intvalglobalize:t@local->t@global(** [Not_found_s] is used by functions that historically raised [Not_found], to allow
them to raise an exception that contains an informative error message (as a sexp),
while still having an exception that can be distinguished from other exceptions. *)exceptionNot_found_soft(** [Of_sexp_error (exn, sexp)] the exception raised when an S-expression could not be
successfully converted to an OCaml-value. *)exceptionOf_sexp_errorofexn*t(** {1 Helpers} *)(** {v
Helper to build nice s-expressions for error messages. It imitates the behavior of
[[%message ...]] from the ppx_sexp_message rewriter.
[message name key_values] produces a s-expression list starting with atom [name] and
followed by list of size 2 of the form [(key value)]. When the key is the empty
string, [value] is used directly instead as for [[%message]].
For instance the following code:
{[
Sexp.message "error"
[ "x", sexp_of_int 42
; "" , sexp_of_exn Exit
]
]}
produces the s-expression:
{[
(error (x 42) Exit)
]}
v} *)valmessage:string->(string*t)list->t(** {1 Defaults} *)(** [default_indent] reference to default indentation level for human-readable
conversions.
Initialisation value: 1. *)valdefault_indent:intDynamic.t(** {1 Pretty printing of S-expressions} *)moduleMake_pretty_printing(Helpers:Pretty_printing_helpers):Pretty_printingwithtypeoutput:=stringincludePretty_printingwithtypeoutput:=string(** See [Pretty_printing.to_string_hum], [to_string_mach], and [to_string],
respectively. *)(** WARNING [to_string_hum__stack] globalizes [t] if it is allocated on the stack. *)valto_string_hum__stack:?indent:int->?max_width:int->t@local->string@localvalto_string_mach__stack:t@local->string@localvalto_string__stack:t@local->string@local(** {1 Styles} *)valof_float_style:[`Underscores|`No_underscores]Dynamic.tvalof_int_style:[`Underscores|`No_underscores]Dynamic.t(*_ See the Jane Street Style Guide for an explanation of [Private] submodules:
https://opensource.janestreet.com/standards/#private-submodules *)modulePrivate:sig(*_ Exported for sexplib *)valsize:t->int*intvalbuffer:unit->Buffer.tincludeDefinitions.Pretty_printing_helpers_privateincludePretty_printingwithtypeoutput:=stringendend