removes useless eventify function
This commit is contained in:
parent
e22ec34000
commit
6481bae328
2 changed files with 14 additions and 17 deletions
15
src/jsx.erl
15
src/jsx.erl
|
@ -30,7 +30,6 @@
|
||||||
-export([json_to_term/1, json_to_term/2]).
|
-export([json_to_term/1, json_to_term/2]).
|
||||||
-export([is_json/1, is_json/2]).
|
-export([is_json/1, is_json/2]).
|
||||||
-export([format/1, format/2]).
|
-export([format/1, format/2]).
|
||||||
-export([eventify/1]).
|
|
||||||
|
|
||||||
|
|
||||||
-include("./include/jsx_common.hrl").
|
-include("./include/jsx_common.hrl").
|
||||||
|
@ -117,20 +116,6 @@ format(JSON, Opts) ->
|
||||||
jsx_format:format(JSON, Opts).
|
jsx_format:format(JSON, Opts).
|
||||||
|
|
||||||
|
|
||||||
-spec eventify(List::list()) -> jsx_parser_result().
|
|
||||||
|
|
||||||
eventify([]) ->
|
|
||||||
fun() ->
|
|
||||||
{incomplete, fun(List) when is_list(List) ->
|
|
||||||
eventify(List)
|
|
||||||
; (_) ->
|
|
||||||
erlang:error(badarg)
|
|
||||||
end}
|
|
||||||
end;
|
|
||||||
eventify([Next|Rest]) ->
|
|
||||||
fun() -> {event, Next, eventify(Rest)} end.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-ifdef(TEST).
|
-ifdef(TEST).
|
||||||
|
|
||||||
|
|
|
@ -60,10 +60,22 @@ term_to_json(List, Opts) ->
|
||||||
; false -> continue
|
; false -> continue
|
||||||
end,
|
end,
|
||||||
Encoding = proplists:get_value(encoding, Opts, utf8),
|
Encoding = proplists:get_value(encoding, Opts, utf8),
|
||||||
jsx:format(jsx:eventify(lists:reverse([end_json] ++ term_to_events(List))),
|
jsx:format(eventify(lists:reverse([end_json] ++ term_to_events(List))),
|
||||||
[{output_encoding, Encoding}] ++ Opts
|
[{output_encoding, Encoding}] ++ Opts
|
||||||
).
|
).
|
||||||
|
|
||||||
|
|
||||||
|
eventify([]) ->
|
||||||
|
fun() ->
|
||||||
|
{incomplete, fun(List) when is_list(List) ->
|
||||||
|
eventify(List)
|
||||||
|
; (_) ->
|
||||||
|
erlang:error(badarg)
|
||||||
|
end}
|
||||||
|
end;
|
||||||
|
eventify([Next|Rest]) ->
|
||||||
|
fun() -> {event, Next, eventify(Rest)} end.
|
||||||
|
|
||||||
|
|
||||||
extract_parser_opts(Opts) ->
|
extract_parser_opts(Opts) ->
|
||||||
extract_parser_opts(Opts, []).
|
extract_parser_opts(Opts, []).
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue