Commit 85a30813 authored by Niels's avatar Niels

removed unnecessary code (numbers must not begin with "+")

parent 688cd49b
...@@ -449,7 +449,7 @@ $ make ...@@ -449,7 +449,7 @@ $ make
$ ./json_unit "*" $ ./json_unit "*"
=============================================================================== ===============================================================================
All tests passed (5568703 assertions in 31 test cases) All tests passed (5568705 assertions in 31 test cases)
``` ```
For more information, have a look at the file [.travis.yml](https://github.com/nlohmann/json/blob/master/.travis.yml). For more information, have a look at the file [.travis.yml](https://github.com/nlohmann/json/blob/master/.travis.yml).
...@@ -8448,10 +8448,6 @@ basic_json_parser_63: ...@@ -8448,10 +8448,6 @@ basic_json_parser_63:
{ {
type = value_t::number_unsigned; type = value_t::number_unsigned;
max = static_cast<uint64_t>(std::numeric_limits<number_unsigned_t>::max()); max = static_cast<uint64_t>(std::numeric_limits<number_unsigned_t>::max());
if (*curptr == '+')
{
curptr++;
}
} }
// count the significant figures // count the significant figures
......
...@@ -7758,10 +7758,6 @@ class basic_json ...@@ -7758,10 +7758,6 @@ class basic_json
{ {
type = value_t::number_unsigned; type = value_t::number_unsigned;
max = static_cast<uint64_t>(std::numeric_limits<number_unsigned_t>::max()); max = static_cast<uint64_t>(std::numeric_limits<number_unsigned_t>::max());
if (*curptr == '+')
{
curptr++;
}
} }
// count the significant figures // count the significant figures
......
...@@ -9776,6 +9776,10 @@ TEST_CASE("parser class") ...@@ -9776,6 +9776,10 @@ TEST_CASE("parser class")
CHECK_THROWS_AS(json::parser("-0e-:").parse(), std::invalid_argument); CHECK_THROWS_AS(json::parser("-0e-:").parse(), std::invalid_argument);
CHECK_THROWS_AS(json::parser("-0f").parse(), std::invalid_argument); CHECK_THROWS_AS(json::parser("-0f").parse(), std::invalid_argument);
// numbers must not begin with "+"
CHECK_THROWS_AS(json::parser("+1").parse(), std::invalid_argument);
CHECK_THROWS_AS(json::parser("+0").parse(), std::invalid_argument);
CHECK_THROWS_WITH(json::parser("01").parse(), CHECK_THROWS_WITH(json::parser("01").parse(),
"parse error - unexpected number literal; expected end of input"); "parse error - unexpected number literal; expected end of input");
CHECK_THROWS_WITH(json::parser("--1").parse(), "parse error - unexpected '-'"); CHECK_THROWS_WITH(json::parser("--1").parse(), "parse error - unexpected '-'");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment