annotate runtime/tools/efm_filter.pl @ 20503:34d4df8db24c

Added tag v8.2.0805 for changeset f28a49da879d8cc2a864ebbdfe3473d34aefaaa3
author Bram Moolenaar <Bram@vim.org>
date Thu, 21 May 2020 20:45:04 +0200
parents 3fc0f57ecb91
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 #!/usr/bin/env perl
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 # This program works as a filter that reads from stdin, copies to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 # stdout *and* creates an error file that can be read by vim.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 # This program has only been tested on SGI, Irix5.3.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 #
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 # Written by Ives Aerts in 1996. This little program is not guaranteed
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 # to do (or not do) anything at all and can be freely used for
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 # whatever purpose you can think of.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 $args = @ARGV;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 unless ($args == 1) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 die("Usage: vimccparse <output filename>\n");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 $filename = @ARGV[0];
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 open (OUT, ">$filename") || die ("Can't open file: \"$filename\"");
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 while (<STDIN>) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 print;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 if ( (/"(.*)", line (\d+): (e)rror\((\d+)\):/)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 || (/"(.*)", line (\d+): (w)arning\((\d+)\):/) ) {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 $file=$1;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 $line=$2;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 $errortype="\u$3";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 $errornr=$4;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 chop($errormsg=<STDIN>);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 $errormsg =~ s/^\s*//;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 $sourceline=<STDIN>;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 $column=index(<STDIN>, "^") - 1;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 print OUT "$file>$line:$column:$errortype:$errornr:$errormsg\n";
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 close(OUT);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 exit(0);