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
2b4e4617
Commit
2b4e4617
authored
May 09, 2015
by
Niels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed string definition
parent
1f381d49
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
21 deletions
+8
-21
json.hpp
src/json.hpp
+5
-20
json.hpp.re2c
src/json.hpp.re2c
+1
-1
unit.cpp
test/unit.cpp
+2
-0
No files found.
src/json.hpp
View file @
2b4e4617
...
@@ -3630,8 +3630,8 @@ class basic_json
...
@@ -3630,8 +3630,8 @@ class basic_json
unsigned
int
yyaccept
=
0
;
unsigned
int
yyaccept
=
0
;
static
const
unsigned
char
yybm
[]
=
static
const
unsigned
char
yybm
[]
=
{
{
0
,
64
,
64
,
64
,
64
,
64
,
64
,
64
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
64
,
32
,
32
,
64
,
64
,
32
,
64
,
64
,
0
,
32
,
32
,
0
,
0
,
32
,
0
,
0
,
64
,
64
,
64
,
64
,
64
,
64
,
64
,
64
,
64
,
64
,
64
,
64
,
64
,
64
,
64
,
64
,
64
,
64
,
64
,
64
,
64
,
64
,
64
,
64
,
64
,
64
,
64
,
64
,
64
,
64
,
64
,
64
,
96
,
64
,
0
,
64
,
64
,
64
,
64
,
64
,
96
,
64
,
0
,
64
,
64
,
64
,
64
,
64
,
...
@@ -3914,26 +3914,11 @@ basic_json_parser_25:
...
@@ -3914,26 +3914,11 @@ basic_json_parser_25:
basic_json_parser_26
:
basic_json_parser_26
:
yyaccept
=
0
;
yyaccept
=
0
;
yych
=
*
(
m_marker
=
++
m_cursor
);
yych
=
*
(
m_marker
=
++
m_cursor
);
if
(
yych
<=
'\n'
)
if
(
yych
<=
0x0F
)
{
{
if
(
yych
<=
0x00
)
{
goto
basic_json_parser_19
;
}
if
(
yych
<=
0x08
)
{
goto
basic_json_parser_31
;
}
goto
basic_json_parser_19
;
goto
basic_json_parser_19
;
}
}
else
goto
basic_json_parser_31
;
{
if
(
yych
==
'\r'
)
{
goto
basic_json_parser_19
;
}
goto
basic_json_parser_31
;
}
basic_json_parser_27
:
basic_json_parser_27
:
++
m_cursor
;
++
m_cursor
;
{
{
...
@@ -3954,7 +3939,7 @@ basic_json_parser_31:
...
@@ -3954,7 +3939,7 @@ basic_json_parser_31:
{
{
goto
basic_json_parser_30
;
goto
basic_json_parser_30
;
}
}
if
(
yych
<=
'\r'
)
if
(
yych
<=
0x0F
)
{
{
goto
basic_json_parser_32
;
goto
basic_json_parser_32
;
}
}
...
...
src/json.hpp.re2c
View file @
2b4e4617
...
@@ -3669,7 +3669,7 @@ class basic_json
...
@@ -3669,7 +3669,7 @@ class basic_json
// string
// string
quotation_mark = [\"];
quotation_mark = [\"];
escape = [\\];
escape = [\\];
unescaped = [^\"\\\
000\t\n\r
];
unescaped = [^\"\\\
x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F
];
single_escaped = [\"\\/bfnrt];
single_escaped = [\"\\/bfnrt];
unicode_escaped = [u][0-9a-fA-F]{4};
unicode_escaped = [u][0-9a-fA-F]{4};
escaped = escape (single_escaped | unicode_escaped);
escaped = escape (single_escaped | unicode_escaped);
...
...
test/unit.cpp
View file @
2b4e4617
...
@@ -7384,6 +7384,8 @@ TEST_CASE("parser class")
...
@@ -7384,6 +7384,8 @@ TEST_CASE("parser class")
// error: newline in string
// error: newline in string
CHECK_THROWS_AS
(
json
::
parser
(
"
\"\n\"
"
).
parse
(),
std
::
invalid_argument
);
CHECK_THROWS_AS
(
json
::
parser
(
"
\"\n\"
"
).
parse
(),
std
::
invalid_argument
);
CHECK_THROWS_AS
(
json
::
parser
(
"
\"\r\"
"
).
parse
(),
std
::
invalid_argument
);
CHECK_THROWS_AS
(
json
::
parser
(
"
\"\r\"
"
).
parse
(),
std
::
invalid_argument
);
// error: backspace in string
CHECK_THROWS_AS
(
json
::
parser
(
"
\"\b\"
"
).
parse
(),
std
::
invalid_argument
);
}
}
SECTION
(
"escaped"
)
SECTION
(
"escaped"
)
...
...
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