reorg of opts parsing, some minor source cleanups

This commit is contained in:
alisdair sullivan 2011-10-19 06:51:36 -07:00
parent 95dd7a67c6
commit 9c5710b97c
7 changed files with 23 additions and 210 deletions

View file

@ -1,11 +0,0 @@
parse_opts(Opts) ->
parse_opts(Opts, #opts{}).
parse_opts([], Opts) ->
Opts;
parse_opts([loose_unicode|Rest], Opts) ->
parse_opts(Rest, Opts#opts{loose_unicode=true});
parse_opts([escape_forward_slash|Rest], Opts) ->
parse_opts(Rest, Opts#opts{escape_forward_slash=true});
parse_opts(_, _) ->
{error, badarg}.

View file

@ -20,12 +20,13 @@
-type jsx_encodeable() :: jsx_event() | [jsx_encodeable()].
-type jsx_iterator() :: jsx_scanner() | jsx_tokenizer().
-type jsx_iterator() :: jsx_scanner().
-type jsx_scanner() :: fun((binary()) -> jsx_iterator_result()).
-type jsx_scanner() :: jsx_decoder() | jsx_tokenizer().
-type jsx_decoder() :: fun((binary()) -> jsx_iterator_result()).
-type jsx_tokenizer() :: fun((jsx_encodeable()) -> jsx_iterator_result()).