feat(generate): warn about unreachable variables (#4567)

This commit is contained in:
Antonin Delpeuch 2025-07-21 11:39:18 +02:00 committed by GitHub
parent 85ab2929e9
commit 25c601bd2f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -247,6 +247,7 @@ pub(crate) fn parse_grammar(input: &str) -> ParseGrammarResult<InputGrammar> {
&mut in_progress,
)
{
eprintln!("Warning: unused variable {name:?}");
grammar_json.conflicts.retain(|r| !r.contains(name));
grammar_json.supertypes.retain(|r| r != name);
grammar_json.inline.retain(|r| r != name);