api change, parser/0,1 deprecated, replaced with decoder/0,1
This commit is contained in:
parent
6cc28573b6
commit
b2d923cbcb
8 changed files with 38 additions and 26 deletions
|
@ -64,11 +64,11 @@
|
|||
|
||||
|
||||
%% this probably doesn't work properly
|
||||
-type jsx_parser() :: fun((binary()) -> jsx_parser_result()).
|
||||
-type jsx_decoder() :: fun((binary()) -> jsx_decoder_result()).
|
||||
|
||||
-type jsx_parser_result() ::
|
||||
{event, jsx_event(), fun(() -> jsx_parser_result())}
|
||||
| {incomplete, jsx_parser()}
|
||||
-type jsx_decoder_result() ::
|
||||
{event, jsx_event(), fun(() -> jsx_decoder_result())}
|
||||
| {incomplete, jsx_decoder()}
|
||||
| {error, {badjson, binary()}}.
|
||||
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
%% this file should take that into account
|
||||
|
||||
|
||||
-spec parser(OptsList::jsx_opts()) -> jsx_parser().
|
||||
-spec decoder(OptsList::jsx_opts()) -> jsx_decoder().
|
||||
|
||||
%% opts record for decoder
|
||||
-record(opts, {
|
||||
|
@ -121,11 +121,11 @@
|
|||
-endif.
|
||||
|
||||
|
||||
-export([parser/1]).
|
||||
-export([decoder/1]).
|
||||
|
||||
|
||||
|
||||
parser(OptsList) ->
|
||||
decoder(OptsList) ->
|
||||
case parse_opts(OptsList) of
|
||||
{error, badopt} -> {error, badopt}
|
||||
; Opts -> fun(JSON) -> start(JSON, [], Opts) end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue