提交 2b4e4617 编写于 作者: N Niels

fixed string definition

上级 1f381d49
......@@ -3630,8 +3630,8 @@ class basic_json
unsigned int yyaccept = 0;
static const unsigned char yybm[] =
{
0, 64, 64, 64, 64, 64, 64, 64,
64, 32, 32, 64, 64, 32, 64, 64,
0, 0, 0, 0, 0, 0, 0, 0,
0, 32, 32, 0, 0, 32, 0, 0,
64, 64, 64, 64, 64, 64, 64, 64,
64, 64, 64, 64, 64, 64, 64, 64,
96, 64, 0, 64, 64, 64, 64, 64,
......@@ -3914,26 +3914,11 @@ basic_json_parser_25:
basic_json_parser_26:
yyaccept = 0;
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;
}
else
{
if (yych == '\r')
{
goto basic_json_parser_19;
}
goto basic_json_parser_31;
}
goto basic_json_parser_31;
basic_json_parser_27:
++m_cursor;
{
......@@ -3954,7 +3939,7 @@ basic_json_parser_31:
{
goto basic_json_parser_30;
}
if (yych <= '\r')
if (yych <= 0x0F)
{
goto basic_json_parser_32;
}
......
......@@ -3669,7 +3669,7 @@ class basic_json
// string
quotation_mark = [\"];
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];
unicode_escaped = [u][0-9a-fA-F]{4};
escaped = escape (single_escaped | unicode_escaped);
......
......@@ -7384,6 +7384,8 @@ TEST_CASE("parser class")
// error: newline in string
CHECK_THROWS_AS(json::parser("\"\n\"").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")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册