json: refine constraint for whitespace to avoid runaways yet allow pretty print (#7866)

This commit is contained in:
Olivier Chafik
2024-06-11 02:22:57 +01:00
committed by GitHub
parent 396b18dfec
commit b61eb9644d
6 changed files with 44 additions and 45 deletions

View File

@@ -40,7 +40,7 @@ static std::string build_repetition(const std::string & item_rule, int min_items
return result;
}
const std::string SPACE_RULE = "\" \"?";
const std::string SPACE_RULE = "| \" \" | \"\\n\" [ \\t]{0,20}";
struct BuiltinRule {
std::string content;