Skip to content

Variant of from_string with richer error type #203

Description

@WardBrian

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions