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