whitespace
This commit is contained in:
parent
d64644e01f
commit
5db827f6ed
1 changed files with 8 additions and 17 deletions
|
@ -21,19 +21,12 @@
|
|||
%% THE SOFTWARE.
|
||||
|
||||
|
||||
|
||||
-module(jsx_terms).
|
||||
|
||||
|
||||
-export([json_to_term/2, term_to_json/2]).
|
||||
|
||||
|
||||
-include("jsx_common.hrl").
|
||||
|
||||
-ifdef(TEST).
|
||||
-include_lib("eunit/include/eunit.hrl").
|
||||
-endif.
|
||||
|
||||
|
||||
-spec json_to_term(JSON::binary(), Opts::decoder_opts()) ->
|
||||
jsx_term() | {jsx, incomplete, fun()}.
|
||||
|
@ -66,7 +59,6 @@ term_to_json(List, Opts) ->
|
|||
end.
|
||||
|
||||
|
||||
|
||||
extract_parser_opts(Opts) ->
|
||||
extract_parser_opts(Opts, []).
|
||||
|
||||
|
@ -78,7 +70,6 @@ extract_parser_opts([{K,V}|Rest], Acc) ->
|
|||
end.
|
||||
|
||||
|
||||
|
||||
%% ensure the first jsx event we get is start_object or start_array when running
|
||||
%% in strict mode
|
||||
collect_strict({jsx, Start, Next}, Acc, Opts)
|
||||
|
@ -170,7 +161,6 @@ event({float, Float}, _Opts) -> Float;
|
|||
event({literal, Literal}, _Opts) -> Literal.
|
||||
|
||||
|
||||
|
||||
%% convert term format representation to jsx events. note special casing for the
|
||||
%% empty object
|
||||
term_to_events([{}]) ->
|
||||
|
@ -218,7 +208,6 @@ key_to_event(Key) when is_binary(Key) ->
|
|||
[{key, json_escape(Key)}].
|
||||
|
||||
|
||||
|
||||
%% json string escaping, for utf8 binaries. escape the json control sequences to
|
||||
%% their json equivalent, escape other control characters to \uXXXX sequences,
|
||||
%% everything else should be a legal json string component
|
||||
|
@ -276,8 +265,10 @@ to_hex(10) -> $a;
|
|||
to_hex(X) -> X + $0.
|
||||
|
||||
|
||||
|
||||
%% eunit tests
|
||||
-ifdef(TEST).
|
||||
-include_lib("eunit/include/eunit.hrl").
|
||||
|
||||
decode_test_() ->
|
||||
[
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue