move clean_string to an include file and inline it in parser and encoder, move tests to jsx_test.hrl
This commit is contained in:
parent
dd302eb7b4
commit
c4405e45a8
5 changed files with 884 additions and 866 deletions
|
@ -198,17 +198,19 @@ fix_key(Key) when is_binary(Key) -> Key.
|
|||
|
||||
|
||||
clean_string(Bin, Tokens, Handler, Stack, Config) ->
|
||||
try jsx_utils:clean_string(Bin, Config)
|
||||
catch error:badarg -> ?error(string, [{string, Bin}|Tokens], Handler, Stack, Config)
|
||||
case clean_string(Bin, Config) of
|
||||
{error, badarg} -> ?error(string, [{string, Bin}|Tokens], Handler, Stack, Config);
|
||||
String -> String
|
||||
end.
|
||||
|
||||
|
||||
-include("jsx_strings.hrl").
|
||||
|
||||
|
||||
-ifdef(TEST).
|
||||
-include_lib("eunit/include/eunit.hrl").
|
||||
|
||||
|
||||
|
||||
parse(Events, Config) ->
|
||||
Chunk = try
|
||||
value(Events ++ [end_json], {jsx, []}, [], jsx_utils:parse_config(Config))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue