Bram Moolenaar | 8c1b8cb | 2022-06-14 17:41:28 +0100 | [diff] [blame] | 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 |
Doug Kearns | 408281e | 2024-04-04 22:00:58 +0200 | [diff] [blame] | 9 | " 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 10 | |
| 11 | if exists("current_compiler") |
| 12 | finish |
| 13 | endif |
| 14 | let current_compiler = "perl" |
| 15 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 16 | let s:savecpo = &cpo |
| 17 | set cpo&vim |
| 18 | |
Bram Moolenaar | 8c1b8cb | 2022-06-14 17:41:28 +0100 | [diff] [blame] | 19 | if get(g:, 'perl_compiler_force_warnings', 1) |
Bram Moolenaar | c1a11ed | 2008-06-24 22:09:24 +0000 | [diff] [blame] | 20 | let s:warnopt = 'W' |
Bram Moolenaar | 8c1b8cb | 2022-06-14 17:41:28 +0100 | [diff] [blame] | 21 | else |
| 22 | let s:warnopt = 'w' |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 23 | endif |
| 24 | |
Bram Moolenaar | c1a11ed | 2008-06-24 22:09:24 +0000 | [diff] [blame] | 25 | if getline(1) =~# '-[^ ]*T' |
| 26 | let s:taintopt = 'T' |
| 27 | else |
| 28 | let s:taintopt = '' |
| 29 | endif |
| 30 | |
Bram Moolenaar | 5477506 | 2019-07-31 21:07:14 +0200 | [diff] [blame] | 31 | exe 'CompilerSet makeprg=perl\ -' . s:warnopt . s:taintopt . 'c\ %:S' |
Bram Moolenaar | c1a11ed | 2008-06-24 22:09:24 +0000 | [diff] [blame] | 32 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 33 | CompilerSet 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 | |
| 47 | let &cpo = s:savecpo |
| 48 | unlet s:savecpo |