Sexp.Annotated
Module for parsing S-expressions annotated with location information
Position information for annotated S-expressions
Range information for annotated S-expressions
S-expression annotated with location information
Type of conversion results of annotated S-expressions.
Exception associated with conversion errors. First argument describes the location, the second the reason.
Stack used by annotation parsers
val parse : ?parse_pos:Parse_pos.t -> ?len:int -> string -> (string, t) parse_result
parse ?parse_pos ?len str
same as parse
, but returns an S-expression annotated with location information.
val parse_bigstring : ?parse_pos:Parse_pos.t -> ?len:int -> bigstring -> (bigstring, t) parse_result
parse_bigstring ?parse_pos ?len str
same as parse_bigstring
, but returns an S-expression annotated with location information.
val input_sexp : ?parse_pos:Parse_pos.t -> in_channel -> t
input_sexp ?parse_pos ic
like input_sexp
, but returns an annotated S-expression instead.
val input_sexps : ?parse_pos:Parse_pos.t -> ?buf:bytes -> in_channel -> t list
input_sexps ?parse_pos ?buf ic
like input_sexps
, but returns a list of annotated S-expressions.
val input_rev_sexps : ?parse_pos:Parse_pos.t -> ?buf:bytes -> in_channel -> t list
input_sexps ?parse_pos ?buf ic
like input_rev_sexps
, but returns a list of annotated S-expressions.
NOTE: these functions should only be used if an annotated S-expression is required.
val load_sexp : ?strict:bool -> ?buf:bytes -> string -> t
load_sexp ?strict ?buf file
like load_sexp
, but returns an annotated S-expression.
val load_sexps : ?buf:bytes -> string -> t list
load_sexps ?buf file
like load_sexps
, but returns a list of annotated S-expressions.
val load_rev_sexps : ?buf:bytes -> string -> t list
load_rev_sexps ?buf file
like load_rev_sexps
, but returns a list of annotated S-expressions.
Converters using annotations for determining error locations
conv f annot_sexp
converts the S-expression associated with annotated S-expression annot_sexp
using f
.
val get_conv_exn : file:string -> exc:exn -> t -> exn
get_conv_exn ~file ~exc annot_sexp