7
|
1 " Vim Compiler File
|
|
2 " Compiler: Perl syntax checks (perl -Wc)
|
|
3 " Maintainer: Christian J. Robinson <infynity@onewest.net>
|
|
4 " Last Change: 2004 Mar 27
|
|
5
|
|
6 if exists("current_compiler")
|
|
7 finish
|
|
8 endif
|
|
9 let current_compiler = "perl"
|
|
10
|
|
11 if exists(":CompilerSet") != 2 " older Vim always used :setlocal
|
|
12 command -nargs=* CompilerSet setlocal <args>
|
|
13 endif
|
|
14
|
|
15 let s:savecpo = &cpo
|
|
16 set cpo&vim
|
|
17
|
|
18 if getline(1) =~# '-[^ ]*T'
|
|
19 CompilerSet makeprg=perl\ -WTc\ %
|
|
20 else
|
|
21 CompilerSet makeprg=perl\ -Wc\ %
|
|
22 endif
|
|
23
|
|
24 CompilerSet errorformat=
|
|
25 \%-G%.%#had\ compilation\ errors.,
|
|
26 \%-G%.%#syntax\ OK,
|
|
27 \%m\ at\ %f\ line\ %l.,
|
|
28 \%+A%.%#\ at\ %f\ line\ %l\\,%.%#,
|
|
29 \%+C%.%#
|
|
30
|
|
31 " Explanation:
|
|
32 " %-G%.%#had\ compilation\ errors., - Ignore the obvious.
|
|
33 " %-G%.%#syntax\ OK, - Don't include the 'a-okay' message.
|
|
34 " %m\ at\ %f\ line\ %l., - Most errors...
|
|
35 " %+A%.%#\ at\ %f\ line\ %l\\,%.%#, - As above, including ', near ...'
|
|
36 " %+C%.%# - ... Which can be multi-line.
|
|
37
|
|
38 let &cpo = s:savecpo
|
|
39 unlet s:savecpo
|