S-expression annotated with location information
Exception associated with conversion errors. First argument describes the location, the second the reason.
Stack used by annotation parsers
find_sexp annot_sexp sexp
Some res
where res
is the
annotated S-expression that is physically equivalent to sexp
in
annot_sexp
, or None
if there is no such S-expression.
parse ?parse_pos ?len str
same as parse, but returns an
S-expression annotated with location information.
parse_bigstring ?parse_pos ?len str
same as parse_bigstring,
but returns an S-expression annotated with location information.
input_sexp ?parse_pos ic
like input_sexp, but returns an
annotated S-expression instead.
input_sexps ?parse_pos ?buf ic
like input_sexps, but returns
a list of annotated S-expressions.
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.
load_sexps ?buf file
like load_sexps, but returns a list of
annotated S-expressions.
load_rev_sexps ?buf file
like load_rev_sexps, but returns a
list of annotated S-expressions.
of_bigstring bstr
same as of_string, but operates on bigstrings.
Converters using annotations for determining error locations
conv f annot_sexp
converts the S-expression associated with
annotated S-expression annot_sexp
using f
.
`Result
res
on success, or `Error (exn, sub_annot_sexp)
otherwise, where
exn
is the exception associated with the conversion error, and
sub_annot_sexp
is the annotated S-expression on which conversion
failed.
get_conv_exn ~file ~exc annot_sexp
file
and exception exc
if conversion had failed on annotated S-expression annot_sexp
.
The format of the exception message is "file:line:col"