It would be really nice to get something that preserved the line number and byte offset as a data type, so that downstream code could print it in a different way (such as showing context around the offending token).
This variant would also not require the fname or lnum parameters, since the calling code could handle that.
Something like
type json_parse_error = { message: string, position: Lexing.position }
val from_string_res : ?buf:Buffer.t -> string -> (t, json_parse_error) Result.t
It would be really nice to get something that preserved the line number and byte offset as a data type, so that downstream code could print it in a different way (such as showing context around the offending token).
This variant would also not require the
fnameorlnumparameters, since the calling code could handle that.Something like