minor api change and refactoring of pretty_printer.erl

This commit is contained in:
alisdair sullivan 2010-05-25 13:31:41 -07:00
parent 6662a1ee98
commit 5d014bbef8
6 changed files with 58 additions and 43 deletions

View file

@ -433,8 +433,8 @@ callback(eof, {none, Callbacks}) ->
lists:reverse(Callbacks);
callback(Event, {none, Callbacks}) ->
{none, [Event] ++ Callbacks};
callback(Event, {Mod, State}) when is_atom(Mod) ->
{Mod, Mod:jsx_event(Event, State)};
callback(Event, {{Mod, Function}, State}) when is_atom(Mod) ->
{{Mod, Function}, Mod:Function(Event, State)};
callback(Event, {F, State}) when is_function(F) ->
{F, F(Event, State)}.