🐛 fix lexer to properly cope with repeated comments #2330

This commit is contained in:
Niels Lohmann
2020-07-31 18:59:22 +02:00
parent 1da931730a
commit 3888b1642a
4 changed files with 12 additions and 2 deletions

View File

@@ -478,4 +478,11 @@ TEST_CASE("regression tests 2")
CHECK(jsonObj["aaaa"] == 11);
CHECK(jsonObj["bbb"] == 222);
}
SECTION("issue #2330 - ignore_comment=true fails on multiple consecutive lines starting with comments")
{
std::string ss = "//\n//\n{\n}\n";
json j = json::parse(ss, nullptr, true, true);
CHECK(j.dump() == "{}");
}
}