Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
json
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
json
Commits
85a30813
Commit
85a30813
authored
May 07, 2016
by
Niels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed unnecessary code (numbers must not begin with "+")
parent
688cd49b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
9 deletions
+5
-9
README.md
README.md
+1
-1
json.hpp
src/json.hpp
+0
-4
json.hpp.re2c
src/json.hpp.re2c
+0
-4
unit.cpp
test/unit.cpp
+4
-0
No files found.
README.md
View file @
85a30813
...
@@ -449,7 +449,7 @@ $ make
...
@@ -449,7 +449,7 @@ $ make
$ ./json_unit "
*
"
$ ./json_unit "
*
"
===============================================================================
===============================================================================
All tests passed (556870
3
assertions in 31 test cases)
All tests passed (556870
5
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
)
.
src/json.hpp
View file @
85a30813
...
@@ -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
...
...
src/json.hpp.re2c
View file @
85a30813
...
@@ -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
...
...
test/unit.cpp
View file @
85a30813
...
@@ -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 '-'"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment