29150
|
1 " Vim compiler file
|
|
2 " Compiler: Perl syntax checks (perl -Wc)
|
|
3 " Maintainer: vim-perl <vim-perl@googlegroups.com>
|
|
4 " Author: Christian J. Robinson <heptite@gmail.com>
|
|
5 " Homepage: https://github.com/vim-perl/vim-perl
|
|
6 " Bugs/requests: https://github.com/vim-perl/vim-perl/issues
|
|
7 " License: Vim License (see :help license)
|
|
8 " Last Change: 2021 Nov 2
|
7
|
9
|
|
10 if exists("current_compiler")
|
|
11 finish
|
|
12 endif
|
|
13 let current_compiler = "perl"
|
|
14
|
|
15 if exists(":CompilerSet") != 2 " older Vim always used :setlocal
|
|
16 command -nargs=* CompilerSet setlocal <args>
|
|
17 endif
|
|
18
|
|
19 let s:savecpo = &cpo
|
|
20 set cpo&vim
|
|
21
|
29150
|
22 if get(g:, 'perl_compiler_force_warnings', 1)
|
|
23 let s:warnopt = 'W'
|
|
24 else
|
1622
|
25 let s:warnopt = 'w'
|
7
|
26 endif
|
|
27
|
1622
|
28 if getline(1) =~# '-[^ ]*T'
|
|
29 let s:taintopt = 'T'
|
|
30 else
|
|
31 let s:taintopt = ''
|
|
32 endif
|
|
33
|
17571
|
34 exe 'CompilerSet makeprg=perl\ -' . s:warnopt . s:taintopt . 'c\ %:S'
|
1622
|
35
|
7
|
36 CompilerSet errorformat=
|
|
37 \%-G%.%#had\ compilation\ errors.,
|
|
38 \%-G%.%#syntax\ OK,
|
|
39 \%m\ at\ %f\ line\ %l.,
|
|
40 \%+A%.%#\ at\ %f\ line\ %l\\,%.%#,
|
|
41 \%+C%.%#
|
|
42
|
|
43 " Explanation:
|
|
44 " %-G%.%#had\ compilation\ errors., - Ignore the obvious.
|
|
45 " %-G%.%#syntax\ OK, - Don't include the 'a-okay' message.
|
|
46 " %m\ at\ %f\ line\ %l., - Most errors...
|
|
47 " %+A%.%#\ at\ %f\ line\ %l\\,%.%#, - As above, including ', near ...'
|
|
48 " %+C%.%# - ... Which can be multi-line.
|
|
49
|
|
50 let &cpo = s:savecpo
|
|
51 unlet s:savecpo
|