home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / runtime / dos / compiler / perl.vim < prev    next >
Encoding:
Text File  |  2010-08-14  |  1.2 KB  |  48 lines

  1. " Vim Compiler File
  2. " Compiler:     Perl syntax checks (perl -Wc)
  3. " Maintainer:   Christian J. Robinson <heptite@gmail.com>
  4. " Last Change:  2006 Aug 13
  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 exists('g:perl_compiler_force_warnings') && g:perl_compiler_force_warnings == 0
  19.     let s:warnopt = 'w'
  20. else
  21.     let s:warnopt = 'W'
  22. endif
  23.  
  24. if getline(1) =~# '-[^ ]*T'
  25.     let s:taintopt = 'T'
  26. else
  27.     let s:taintopt = ''
  28. endif
  29.  
  30. exe 'CompilerSet makeprg=perl\ -' . s:warnopt . s:taintopt . 'c\ %'
  31.  
  32. CompilerSet errorformat=
  33.     \%-G%.%#had\ compilation\ errors.,
  34.     \%-G%.%#syntax\ OK,
  35.     \%m\ at\ %f\ line\ %l.,
  36.     \%+A%.%#\ at\ %f\ line\ %l\\,%.%#,
  37.     \%+C%.%#
  38.  
  39. " Explanation:
  40. " %-G%.%#had\ compilation\ errors.,  - Ignore the obvious.
  41. " %-G%.%#syntax\ OK,                 - Don't include the 'a-okay' message.
  42. " %m\ at\ %f\ line\ %l.,             - Most errors...
  43. " %+A%.%#\ at\ %f\ line\ %l\\,%.%#,  - As above, including ', near ...'
  44. " %+C%.%#                            -   ... Which can be multi-line.
  45.  
  46. let &cpo = s:savecpo
  47. unlet s:savecpo
  48.