2013-06-17 07:52:12 -04:00
|
|
|
"============================================================================
|
|
|
|
"File: cobc.vim
|
|
|
|
"Description: Syntax checking plugin for syntastic.vim
|
|
|
|
"Maintainer: LCD 47 <lcd047 at gmail dot com>
|
|
|
|
"License: This program is free software. It comes without any warranty,
|
|
|
|
" to the extent permitted by applicable law. You can redistribute
|
|
|
|
" it and/or modify it under the terms of the Do What The Fuck You
|
|
|
|
" Want To Public License, Version 2, as published by Sam Hocevar.
|
|
|
|
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
|
|
|
"
|
|
|
|
"============================================================================
|
|
|
|
|
|
|
|
|
|
|
|
if exists('g:loaded_syntastic_cobol_cobc_checker')
|
|
|
|
finish
|
|
|
|
endif
|
|
|
|
let g:loaded_syntastic_cobol_cobc_checker = 1
|
|
|
|
|
2014-02-08 02:45:51 -05:00
|
|
|
if !exists('g:syntastic_cobol_compiler_options')
|
|
|
|
let g:syntastic_cobol_compiler_options = ''
|
2013-06-17 07:52:12 -04:00
|
|
|
endif
|
|
|
|
|
2014-01-03 04:29:08 -05:00
|
|
|
let s:save_cpo = &cpo
|
|
|
|
set cpo&vim
|
|
|
|
|
2013-10-28 11:30:25 -04:00
|
|
|
function! SyntaxCheckers_cobol_cobc_IsAvailable() dict
|
2014-02-08 02:45:51 -05:00
|
|
|
if !exists('g:syntastic_cobol_compiler')
|
|
|
|
let g:syntastic_cobol_compiler = self.getExec()
|
|
|
|
endif
|
2014-10-06 15:15:44 -04:00
|
|
|
call self.log('g:syntastic_cobol_compiler =', g:syntastic_cobol_compiler)
|
2013-10-28 11:30:25 -04:00
|
|
|
return executable(expand(g:syntastic_cobol_compiler))
|
2013-06-17 07:52:12 -04:00
|
|
|
endfunction
|
|
|
|
|
2013-10-28 07:53:33 -04:00
|
|
|
function! SyntaxCheckers_cobol_cobc_GetLocList() dict
|
2013-06-25 02:59:07 -04:00
|
|
|
return syntastic#c#GetLocList('cobol', 'cobc', {
|
2013-06-17 07:52:12 -04:00
|
|
|
\ 'errorformat': '%f:%l: %trror: %m',
|
2013-06-24 04:46:27 -04:00
|
|
|
\ 'main_flags': '-fsyntax-only' })
|
2013-06-17 07:52:12 -04:00
|
|
|
endfunction
|
|
|
|
|
|
|
|
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
|
|
|
\ 'filetype': 'cobol',
|
2014-02-08 02:45:51 -05:00
|
|
|
\ 'name': 'cobc' })
|
2013-06-17 07:52:12 -04:00
|
|
|
|
|
|
|
let &cpo = s:save_cpo
|
|
|
|
unlet s:save_cpo
|
|
|
|
|
|
|
|
" vim: set et sts=4 sw=4:
|