mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-29 03:37:55 +00:00
* followup #18711 cleanup unused grammar rules * make tools/grammar_nanny.nim report unused terminals * revert removal of some grammar comments
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
import std / [strutils, sets]
|
||||
|
||||
import ".." / compiler / [
|
||||
llstream, ast, lexer, options, msgs, idents,
|
||||
llstream, lexer, options, msgs, idents,
|
||||
lineinfos, pathutils]
|
||||
|
||||
proc checkGrammarFileImpl(cache: IdentCache, config: ConfigRef) =
|
||||
@@ -35,6 +35,10 @@ proc checkGrammarFileImpl(cache: IdentCache, config: ConfigRef) =
|
||||
usedSyms.incl word
|
||||
else:
|
||||
rawGetTok(L, tok)
|
||||
for u in declaredSyms:
|
||||
if u notin usedSyms:
|
||||
echo "Unused non-terminal: ", u
|
||||
|
||||
for u in usedSyms:
|
||||
if u notin declaredSyms:
|
||||
echo "Undeclared non-terminal: ", u
|
||||
|
||||
Reference in New Issue
Block a user