RELEASE/1.2debug-cidebug-ci-sanitisersfaster-cavernlogwalls-datawalls-data-hanging-as-warning
Last change
on this file since 2e436eb was
c40038a,
checked in by Olly Betts <olly@…>, 22 years ago
|
Vastly improved msg.pl script for extracting messages from source code.
Compared its output to message file and fixed up discrepancies.
git-svn-id: file:///home/survex-svn/survex/trunk@1872 4b37db11-9a0c-4f06-9ece-9ab7cdaee568
|
-
Property mode set to
100644
|
File size:
857 bytes
|
Line | |
---|
1 | #!/usr/bin/perl -w |
---|
2 | my @msgs; |
---|
3 | my $exitcode = 0; |
---|
4 | use strict; |
---|
5 | while (<>) { |
---|
6 | while (m!/\*(.*?)\*/([0-9]+)\b!g) { |
---|
7 | if (defined $msgs[$2] && $msgs[$2] ne $1) { |
---|
8 | print STDERR "Message $2 has two different versions:\n"; |
---|
9 | print STDERR "\"$msgs[$2]\"\n\"$1\"\n"; |
---|
10 | $exitcode = 1; |
---|
11 | } |
---|
12 | $msgs[$2] = $1; |
---|
13 | } |
---|
14 | } |
---|
15 | my $i = 0; |
---|
16 | my $xxx; |
---|
17 | for my $msg (@msgs) { |
---|
18 | if (!defined $msg) { |
---|
19 | if (!defined $xxx) { |
---|
20 | $xxx = $i; |
---|
21 | } |
---|
22 | } else { |
---|
23 | if (defined $xxx) { |
---|
24 | print "# XXX $xxx"; |
---|
25 | print "-", ($i - 1) if ($i - 1 > $xxx); |
---|
26 | print "\n"; |
---|
27 | $xxx = undef; |
---|
28 | } |
---|
29 | printf "en:%3d ", $i; |
---|
30 | if ($msg =~ /^\s/ || $msg =~ /\s$/) { |
---|
31 | print "\"$msg\"\n"; |
---|
32 | } else { |
---|
33 | print "$msg\n"; |
---|
34 | } |
---|
35 | } |
---|
36 | ++$i; |
---|
37 | } |
---|
38 | if (defined $xxx) { |
---|
39 | print "# XXX $xxx"; |
---|
40 | print "-", ($i - 1) if ($i - 1 > $xxx); |
---|
41 | print "\n"; |
---|
42 | $xxx = undef; |
---|
43 | } |
---|
44 | exit $exitcode; |
---|
Note: See
TracBrowser
for help on using the repository browser.