2012-06-02 10:00:37 -04:00
|
|
|
"============================================================================
|
|
|
|
"File: d.vim
|
|
|
|
"Description: Syntax checking plugin for syntastic.vim
|
|
|
|
"Maintainer: Alfredo Di Napoli <alfredo dot dinapoli at gmail dot com>
|
2012-06-02 10:11:59 -04:00
|
|
|
"License: Based on the original work of Gregor Uhlenheuer and his
|
|
|
|
" cpp.vim checker so credits are dued.
|
|
|
|
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
|
|
" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
|
|
" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
|
|
" NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
|
|
" HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
|
|
" WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
|
|
" OTHER DEALINGS IN THE SOFTWARE.
|
2012-06-02 10:00:37 -04:00
|
|
|
"
|
|
|
|
"============================================================================
|
|
|
|
|
2013-04-24 04:02:03 -04:00
|
|
|
if exists('g:loaded_syntastic_d_dmd_checker')
|
|
|
|
finish
|
|
|
|
endif
|
|
|
|
let g:loaded_syntastic_d_dmd_checker = 1
|
|
|
|
|
|
|
|
if !exists('g:syntastic_d_compiler')
|
|
|
|
let g:syntastic_d_compiler = 'dmd'
|
|
|
|
endif
|
|
|
|
|
|
|
|
function! SyntaxCheckers_d_dmd_IsAvailable()
|
|
|
|
return executable(g:syntastic_d_compiler)
|
|
|
|
endfunction
|
2012-06-02 10:00:37 -04:00
|
|
|
|
|
|
|
let s:save_cpo = &cpo
|
|
|
|
set cpo&vim
|
|
|
|
|
2013-04-24 04:02:03 -04:00
|
|
|
if !exists('g:syntastic_d_compiler_options')
|
|
|
|
let g:syntastic_d_compiler_options = ''
|
2013-02-21 10:50:41 -05:00
|
|
|
endif
|
|
|
|
|
2013-01-27 15:08:30 -05:00
|
|
|
function! SyntaxCheckers_d_dmd_GetLocList()
|
2013-06-25 02:59:07 -04:00
|
|
|
return syntastic#c#GetLocList('d', 'dmd', {
|
2013-05-21 03:03:04 -04:00
|
|
|
\ 'errorformat':
|
|
|
|
\ '%-G%f:%s:,%f(%l): %m,' .
|
|
|
|
\ '%f:%l: %m',
|
2013-06-24 04:46:27 -04:00
|
|
|
\ 'main_flags': '-c -of' . syntastic#util#DevNull(),
|
|
|
|
\ 'header_names': '\.di$' })
|
2012-06-02 10:00:37 -04:00
|
|
|
endfunction
|
|
|
|
|
2013-01-27 15:08:30 -05:00
|
|
|
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
|
|
|
\ 'filetype': 'd',
|
|
|
|
\ 'name': 'dmd'})
|
|
|
|
|
2012-06-02 10:00:37 -04:00
|
|
|
let &cpo = s:save_cpo
|
|
|
|
unlet s:save_cpo
|
|
|
|
|
|
|
|
" vim: set et sts=4 sw=4:
|