Merge pull request #2401 from amaanq/fix-inline-bug
fix: disallow inlining the first rule
This commit is contained in:
commit
fc1514d0cd
1 changed files with 6 additions and 0 deletions
|
|
@ -203,6 +203,12 @@ pub(super) fn process_inlines(
|
|||
lexical_grammar.variables[symbol.index].name,
|
||||
))
|
||||
}
|
||||
SymbolType::NonTerminal if symbol.index == 0 => {
|
||||
return Err(anyhow!(
|
||||
"Rule `{}` cannot be inlined because it is the first rule",
|
||||
grammar.variables[symbol.index].name,
|
||||
))
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue