View Source euneus_decoder (euneus v0.6.0)

JSON parser.

Summary

Types

-type error_class() :: error | exit | throw.
-type error_handler() :: fun((error_class(), error_reason(), error_stacktrace()) -> error_stacktrace()).
-type error_stacktrace() :: erlang:stacktrace().
-type input() :: binary() | iolist().
Link to this type

invalid_option_error/0

View Source
-type invalid_option_error() :: {invalid_option, term()}.
-type normalizer(Term) :: fun((Term, options()) -> term()).
-type options() ::
    #{null_term => term(),
      keys => normalizer(Key :: binary()),
      values => normalizer(Value :: binary()),
      arrays => normalizer(Array :: list()),
      objects => normalizer(Object :: map()),
      error_handler => error_handler()}.
-type position() :: non_neg_integer().
-type result() :: {ok, term()} | {error, error_reason()}.
Link to this type

unexpected_byte_error/0

View Source
-type unexpected_byte_error() :: {unexpected_byte, binary(), position()}.
Link to this type

unexpected_end_of_input_error/0

View Source
-type unexpected_end_of_input_error() :: unexpected_end_of_input.
Link to this type

unexpected_sequence_error/0

View Source
-type unexpected_sequence_error() :: {unexpected_sequence, binary(), position()}.

Functions

-spec decode(input(), map()) -> result().
Link to this function

decode_parsed(Bin, Opts)

View Source
-spec decode_parsed(input(), options()) -> result().
Link to this function

handle_error(Class, Reason, Stacktrace)

View Source
-spec parse_opts(map()) -> options().
Link to this function

resume(Token, Rest0, Opts, Input, Pos0, Buffer)

View Source
Link to this function

resume(Token, Replacement, Rest0, Opts, Input, Pos0, Buffer)

View Source