forked from github/server
- Syntax-Prüfung für messages.txt
This commit is contained in:
parent
a916e6efc3
commit
bb245c9d4a
1 changed files with 23 additions and 0 deletions
23
src/tools/syntax-test-messages.pl
Executable file
23
src/tools/syntax-test-messages.pl
Executable file
|
@ -0,0 +1,23 @@
|
||||||
|
#!/usr/bin/perl
|
||||||
|
# vi:set ts=2:
|
||||||
|
|
||||||
|
$errorcount = 0;
|
||||||
|
$linecount = 0;
|
||||||
|
|
||||||
|
while(<>) {
|
||||||
|
$line = $_;
|
||||||
|
|
||||||
|
$linecount++;
|
||||||
|
|
||||||
|
if($line !~ /^\s*#/ && $line !~ /^\s*$/ && $line !~ /^\w+;(events|magic|errors|study|economy|battle|movement|production):[012345];(de|en);.+/) {
|
||||||
|
print "syntax error in line $linecount: $line\n";
|
||||||
|
$errorcount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if($errorcount > 0) {
|
||||||
|
print "$errorcount errors found.\n";
|
||||||
|
} else {
|
||||||
|
print "No errors found.\n";
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue