We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent df5478f commit 1262e7eCopy full SHA for 1262e7e
common/grammar-parser.cpp
@@ -369,6 +369,9 @@ namespace grammar_parser {
369
}
370
// Validate the state to ensure that all rules are defined
371
for (const auto & rule : state.rules) {
372
+ if (rule.empty()) {
373
+ throw std::runtime_error("Undefined rule");
374
+ }
375
for (const auto & elem : rule) {
376
if (elem.type == LLAMA_GRETYPE_RULE_REF) {
377
// Ensure that the rule at that location exists
0 commit comments