removes useless eventify function

This commit is contained in:
alisdair sullivan 2011-04-16 22:25:02 -07:00
parent e22ec34000
commit 6481bae328
2 changed files with 14 additions and 17 deletions

View file

@ -60,10 +60,22 @@ term_to_json(List, Opts) ->
; false -> continue
end,
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
).
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, []).