annotate runtime/tools/efm_filter.pl @ 27970:212c5894b8b1 v8.2.4510

patch 8.2.4510: Vim9: shortening commands leads to confusing script Commit: https://github.com/vim/vim/commit/204852ae2adfdde10c656ca7f14e5b4207a69172 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Mar 5 12:56:44 2022 +0000 patch 8.2.4510: Vim9: shortening commands leads to confusing script Problem: Vim9: shortening commands leads to confusing script. Solution: In Vim9 script require at least ":cont" for ":continue", "const" instead of "cons", "break" instead of "brea", "catch" instead of "cat", "else" instead of "el" "elseif" instead of "elsei" "endfor" instead of "endfo" "endif" instead of "en" "endtry" instead of "endt", "finally" instead of "fina", "throw" instead of "th", "while" instead of "wh".
author Bram Moolenaar <Bram@vim.org>
date Sat, 05 Mar 2022 14:00:03 +0100
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);