diff options
author | Adam Borowski <kilobyte@angband.pl> | 2012-05-20 22:42:43 +0200 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2012-05-20 22:42:43 +0200 |
commit | 6a6dfe83adae4e87335f88e7cf2b336b572aa0a9 (patch) | |
tree | 1e8dbd6761ed0c7c45928c12bd4aa97587210428 /crawl-ref/source/util/db_lint | |
parent | 203f01e0a484c19917c44f8dd81ce0ac3de2dd0b (diff) | |
download | crawl-ref-6a6dfe83adae4e87335f88e7cf2b336b572aa0a9.tar.gz crawl-ref-6a6dfe83adae4e87335f88e7cf2b336b572aa0a9.zip |
Check db references for local keys (ie, ones names _something_).
Diffstat (limited to 'crawl-ref/source/util/db_lint')
-rwxr-xr-x | crawl-ref/source/util/db_lint | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/crawl-ref/source/util/db_lint b/crawl-ref/source/util/db_lint index 6c37df3e57..9022ba353b 100755 --- a/crawl-ref/source/util/db_lint +++ b/crawl-ref/source/util/db_lint @@ -67,6 +67,19 @@ sub read_file($) close F; } +sub check_db_locals() +{ + my (%locals, %keys); + $keys{$_}=1 for keys %entries; + $locals{$_}=1 for map /@(_[^@\n]+_)@/g, values %entries; + for (sort keys %locals) + { + err("Undefined local entry '$_'\n") unless $entries{$_}; + delete $keys{$_}; + } + err("Unused local entry '$_' at $source{$_}\n") for grep /^_.*_$/, keys %keys; +} + __________________________________________________________________________(); read_file("descript/features"); read_file("descript/items"); @@ -114,10 +127,13 @@ __________________________________________________________________________(); read_file("descript/$_") for qw(species backgrounds); __________________________________________________________________________(); read_file("database/$_") for qw(randname rand_wpn rand_arm rand_all randbook monname); +check_db_locals(); __________________________________________________________________________(); read_file("database/$_") for qw(monspeak monspell monflee wpnnoise insult godspeak); +check_db_locals(); __________________________________________________________________________(); read_file("database/$_") for qw(shout insult); +check_db_locals(); __________________________________________________________________________(); read_file("descript/quotes"); __________________________________________________________________________(); |