fixed a misleading comment about eventify
This commit is contained in:
parent
dbc6dd4f80
commit
485c4d74ea
1 changed files with 3 additions and 2 deletions
|
@ -110,10 +110,11 @@ format(JSON, Opts) ->
|
|||
|
||||
-spec eventify(List::list()) -> jsx_parser_result().
|
||||
|
||||
%% fake the jsx api with a closure to be passed to the pretty printer
|
||||
%% fake the jsx api for any list, useful if you want to serialize a structure to
|
||||
%% json using the pretty printer, or verify a sequence could be valid json
|
||||
|
||||
eventify([]) ->
|
||||
fun() -> {incomplete, fun(end_stream) -> eventify([]) end} end;
|
||||
fun() -> {incomplete, fun(List) when is_list(List) -> eventify(List); (_) -> erlang:error(badarg) end} end;
|
||||
eventify([Next|Rest]) ->
|
||||
fun() -> {event, Next, eventify(Rest)} end.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue