blob: 6aeaac3fa1856b38e3125093b8ff314370b548d3 [file] [log] [blame]
Bram Moolenaar8c1b8cb2022-06-14 17:41:28 +01001" 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
Doug Kearns408281e2024-04-04 22:00:58 +02009" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition)
Bram Moolenaar071d4272004-06-13 20:20:40 +000010
11if exists("current_compiler")
12 finish
13endif
14let current_compiler = "perl"
15
Bram Moolenaar071d4272004-06-13 20:20:40 +000016let s:savecpo = &cpo
17set cpo&vim
18
Bram Moolenaar8c1b8cb2022-06-14 17:41:28 +010019if get(g:, 'perl_compiler_force_warnings', 1)
Bram Moolenaarc1a11ed2008-06-24 22:09:24 +000020 let s:warnopt = 'W'
Bram Moolenaar8c1b8cb2022-06-14 17:41:28 +010021else
22 let s:warnopt = 'w'
Bram Moolenaar071d4272004-06-13 20:20:40 +000023endif
24
Bram Moolenaarc1a11ed2008-06-24 22:09:24 +000025if getline(1) =~# '-[^ ]*T'
26 let s:taintopt = 'T'
27else
28 let s:taintopt = ''
29endif
30
Bram Moolenaar54775062019-07-31 21:07:14 +020031exe 'CompilerSet makeprg=perl\ -' . s:warnopt . s:taintopt . 'c\ %:S'
Bram Moolenaarc1a11ed2008-06-24 22:09:24 +000032
Bram Moolenaar071d4272004-06-13 20:20:40 +000033CompilerSet errorformat=
34 \%-G%.%#had\ compilation\ errors.,
35 \%-G%.%#syntax\ OK,
36 \%m\ at\ %f\ line\ %l.,
37 \%+A%.%#\ at\ %f\ line\ %l\\,%.%#,
38 \%+C%.%#
39
40" Explanation:
41" %-G%.%#had\ compilation\ errors., - Ignore the obvious.
42" %-G%.%#syntax\ OK, - Don't include the 'a-okay' message.
43" %m\ at\ %f\ line\ %l., - Most errors...
44" %+A%.%#\ at\ %f\ line\ %l\\,%.%#, - As above, including ', near ...'
45" %+C%.%# - ... Which can be multi-line.
46
47let &cpo = s:savecpo
48unlet s:savecpo