diff --git a/CHANGES.md b/CHANGES.md index f68c14f..bd06080 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,7 @@ +v2.5.2 + +* fix regression parsing <<"-0e...">> (thanks @c-bik) + v2.5.1 * assume all datetimes are UTC time and add `Z` designator to indicate diff --git a/README.md b/README.md index e096d6f..77b1238 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -# jsx (v2.5.1) # +# jsx (v2.5.2) # + an erlang application for consuming, producing and manipulating [json][json]. inspired by [yajl][yajl] @@ -707,7 +708,7 @@ following events must be handled: ## acknowledgements ## -jsx wouldn't be what it is without the contributions of [paul davis](https://github.com/davisp), [lloyd hilaiel](https://github.com/lloyd), [john engelhart](https://github.com/johnezang), [bob ippolito](https://github.com/etrepum), [fernando benavides](https://github.com/elbrujohalcon), [alex kropivny](https://github.com/amtal), [steve strong](https://github.com/srstrong), [michael truog](https://github.com/okeuday), [devin torres](https://github.com/devinus), [dmitry kolesnikov](https://github.com/fogfish), [emptytea](https://github.com/emptytea), [john daily](https://github.com/macintux), [ola bäckström](https://github.com/olabackstrom), [joseph crowe](https://github.com/JosephCrowe), [patrick gombert](https://github.com/patrickgombert), [eskuat](https://github.com/eskuat) and [max lapshin](https://github.com/maxlapshin) +jsx wouldn't be what it is without the contributions of [paul davis](https://github.com/davisp), [lloyd hilaiel](https://github.com/lloyd), [john engelhart](https://github.com/johnezang), [bob ippolito](https://github.com/etrepum), [fernando benavides](https://github.com/elbrujohalcon), [alex kropivny](https://github.com/amtal), [steve strong](https://github.com/srstrong), [michael truog](https://github.com/okeuday), [devin torres](https://github.com/devinus), [dmitry kolesnikov](https://github.com/fogfish), [emptytea](https://github.com/emptytea), [john daily](https://github.com/macintux), [ola bäckström](https://github.com/olabackstrom), [joseph crowe](https://github.com/JosephCrowe), [patrick gombert](https://github.com/patrickgombert), [eskuat](https://github.com/eskuat), [max lapshin](https://github.com/maxlapshin) and [bikram chatterjee](https://github.com/c-bik) [json]: http://json.org [yajl]: http://lloyd.github.com/yajl diff --git a/src/jsx.app.src b/src/jsx.app.src index 2910003..e623210 100644 --- a/src/jsx.app.src +++ b/src/jsx.app.src @@ -1,7 +1,7 @@ {application, jsx, [ {description, "a streaming, evented json parsing toolkit"}, - {vsn, "2.5.1"}, + {vsn, "2.5.2"}, {modules, [ jsx, jsx_encoder, diff --git a/src/jsx_decoder.erl b/src/jsx_decoder.erl index e6b4152..0f03975 100644 --- a/src/jsx_decoder.erl +++ b/src/jsx_decoder.erl @@ -892,6 +892,8 @@ number(Bin, Handler, Acc, [State|Stack], Config) -> zero(<>, N) -> initialdecimal(Rest, N + 1); +zero(<<$e, _/binary>>, N) -> {integer, N}; +zero(<<$E, _/binary>>, N) -> {integer, N}; zero(<<>>, N) -> {zero, N}; zero(_, N) -> {finish_integer, N}. @@ -1171,6 +1173,7 @@ special_number_test_() -> {"0e4", [{float, 0.0}, end_json], <<"0e4">>}, {"1e0", [{float, 1.0}, end_json], <<"1e0">>}, {"-1e0", [{float, -1.0}, end_json], <<"-1e0">>}, + {"-0e0", [{float, -0.0}, end_json], <<"-0e0">>}, {"1e4", [{float, 1.0e4}, end_json], <<"1e4">>}, {"number terminated by whitespace", [start_array, {integer, 1}, end_array, end_json],