Skip to content

Commit

Permalink
fixed a misleading comment about eventify
Browse files Browse the repository at this point in the history
  • Loading branch information
alisdair sullivan committed Aug 13, 2010
1 parent dbc6dd4 commit 485c4d7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/jsx.erl
Expand Up @@ -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.

Expand Down

0 comments on commit 485c4d7

Please sign in to comment.