diff --git a/src/json.hpp b/src/json.hpp index dfd7bb705..5ca2ccc80 100644 --- a/src/json.hpp +++ b/src/json.hpp @@ -3666,8 +3666,8 @@ class basic_json if ((m_limit - m_cursor) < 5) { - yyfill(); - }; + yyfill(); // LCOV_EXCL_LINE; + } yych = *m_cursor; if (yych <= '9') { @@ -3801,8 +3801,8 @@ basic_json_parser_4: ++m_cursor; if (m_limit <= m_cursor) { - yyfill(); - }; + yyfill(); // LCOV_EXCL_LINE; + } yych = *m_cursor; basic_json_parser_5: if (yybm[0 + yych] & 32) @@ -3946,8 +3946,8 @@ basic_json_parser_30: ++m_cursor; if (m_limit <= m_cursor) { - yyfill(); - }; + yyfill(); // LCOV_EXCL_LINE; + } yych = *m_cursor; basic_json_parser_31: if (yybm[0 + yych] & 64) @@ -3977,8 +3977,8 @@ basic_json_parser_33: ++m_cursor; if (m_limit <= m_cursor) { - yyfill(); - }; + yyfill(); // LCOV_EXCL_LINE; + } yych = *m_cursor; if (yych <= 'e') { @@ -4061,8 +4061,8 @@ basic_json_parser_36: ++m_cursor; if (m_limit <= m_cursor) { - yyfill(); - }; + yyfill(); // LCOV_EXCL_LINE; + } yych = *m_cursor; if (yych <= '@') { @@ -4094,8 +4094,8 @@ basic_json_parser_37: ++m_cursor; if (m_limit <= m_cursor) { - yyfill(); - }; + yyfill(); // LCOV_EXCL_LINE; + } yych = *m_cursor; if (yych <= '@') { @@ -4127,8 +4127,8 @@ basic_json_parser_38: ++m_cursor; if (m_limit <= m_cursor) { - yyfill(); - }; + yyfill(); // LCOV_EXCL_LINE; + } yych = *m_cursor; if (yych <= '@') { @@ -4160,8 +4160,8 @@ basic_json_parser_39: ++m_cursor; if (m_limit <= m_cursor) { - yyfill(); - }; + yyfill(); // LCOV_EXCL_LINE; + } yych = *m_cursor; if (yych <= '@') { @@ -4196,8 +4196,8 @@ basic_json_parser_40: m_marker = ++m_cursor; if ((m_limit - m_cursor) < 3) { - yyfill(); - }; + yyfill(); // LCOV_EXCL_LINE; + } yych = *m_cursor; basic_json_parser_41: if (yybm[0 + yych] & 128) @@ -4273,8 +4273,8 @@ basic_json_parser_45: ++m_cursor; if (m_limit <= m_cursor) { - yyfill(); - }; + yyfill(); // LCOV_EXCL_LINE; + } yych = *m_cursor; if (yych <= '/') { @@ -4290,8 +4290,8 @@ basic_json_parser_47: m_marker = ++m_cursor; if ((m_limit - m_cursor) < 3) { - yyfill(); - }; + yyfill(); // LCOV_EXCL_LINE; + } yych = *m_cursor; if (yych <= 'D') { diff --git a/src/json.hpp.re2c b/src/json.hpp.re2c index 51622f5a1..d2b12f5d1 100644 --- a/src/json.hpp.re2c +++ b/src/json.hpp.re2c @@ -3629,7 +3629,7 @@ class basic_json re2c:define:YYCURSOR = m_cursor; re2c:define:YYLIMIT = m_limit; re2c:define:YYMARKER = m_marker; - re2c:define:YYFILL = "{ yyfill(); }"; + re2c:define:YYFILL = "yyfill(); // LCOV_EXCL_LINE"; re2c:yyfill:parameter = 0; re2c:indent:string = " "; re2c:indent:top = 1; diff --git a/test/unit.cpp b/test/unit.cpp index 58ad4d68f..295ddc7ad 100644 --- a/test/unit.cpp +++ b/test/unit.cpp @@ -7405,21 +7405,6 @@ TEST_CASE("parser class") // horizontal tab CHECK(json::parser("\"\\t\"").parse() == json("\t")); - // exotic test cases for full coverage - { - // that one got illegal - //{ - // std::stringstream ss; - // ss << "\"\\u000\n1\""; - // CHECK(json::parser(ss).parse().get() == "\x01"); - //} - //{ - // std::stringstream ss; - // ss << "\"\\u00\n01\""; - // CHECK(json::parser(ss).parse().get() == "\x01"); - //} - } - CHECK(json::parser("\"\\u0001\"").parse().get() == "\x01"); CHECK(json::parser("\"\\u000a\"").parse().get() == "\n"); CHECK(json::parser("\"\\u00b0\"").parse().get() == "°");