diff options
author | Olivier Chafik <ochafik@users.noreply.github.com> | 2024-06-11 01:00:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-11 01:00:30 +0100 |
commit | 396b18dfec2c56846e80362db70af09b9e1d70ba (patch) | |
tree | 2081089863e80e93a906424c8fa15ac4e3fa091f /common/json-schema-to-grammar.cpp | |
parent | 864a99e7a01d9422d2f55618dbe62c8099a2175c (diff) |
`json`: document schema conversion in GBNF readme, align manual grammar examples & converters (#7841)
* json: fix char pattern in grammar converters
* json: prevent number precision & whitespace runaways in example grammars
* json: add doc to grammar readme
Diffstat (limited to 'common/json-schema-to-grammar.cpp')
-rw-r--r-- | common/json-schema-to-grammar.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/common/json-schema-to-grammar.cpp b/common/json-schema-to-grammar.cpp index 737bae27..11221a32 100644 --- a/common/json-schema-to-grammar.cpp +++ b/common/json-schema-to-grammar.cpp @@ -57,7 +57,7 @@ std::unordered_map<std::string, BuiltinRule> PRIMITIVE_RULES = { {"object", {"\"{\" space ( string \":\" space value (\",\" space string \":\" space value)* )? \"}\" space", {"string", "value"}}}, {"array", {"\"[\" space ( value (\",\" space value)* )? \"]\" space", {"value"}}}, {"uuid", {"\"\\\"\" [0-9a-fA-F]{8} \"-\" [0-9a-fA-F]{4} \"-\" [0-9a-fA-F]{4} \"-\" [0-9a-fA-F]{4} \"-\" [0-9a-fA-F]{12} \"\\\"\" space", {}}}, - {"char", {"[^\"\\\\] | \"\\\\\" ([\"\\\\/bfnrt] | \"u\" [0-9a-fA-F]{4})", {}}}, + {"char", {"[^\"\\\\\\x7F\\x00-\\x1F] | [\\\\] ([\"\\\\bfnrt] | \"u\" [0-9a-fA-F]{4})", {}}}, {"string", {"\"\\\"\" char* \"\\\"\" space", {"char"}}}, {"null", {"\"null\" space", {}}}, }; |