Git init
[external/xmlsec1.git] / scripts / test_errors.pl
1 #!/usr/bin/perl
2
3 my $file;
4 while ($file = shift @ARGV) {
5     # print "Processing file $file...\n";
6     open(IN, "$file") || die "Unable to open file $file";
7     $state = "";
8     $line=0;
9     while(<IN>) {
10         $line++;
11         chomp;
12         
13         if($state eq "") {
14             if(/xmlSecError\((.*)/) {
15                 $state = "$file,$line," . $1;
16             }
17         } else {
18             if(/(.*);/) {
19                 $_ = $state . $1;
20                 $state = "";
21
22                 while(/\t/) {
23                     s/\t//;
24                 }
25                 while(/\, /) {
26                     s/\, /\,/;
27                 }
28                 while(/\,/) {
29                     s/\,/\;/;
30                 }               
31                 print "$_\n";
32             } else {
33                 $state = $state . $_;
34             }
35         }
36     }
37     close IN;
38 }