1 "============================================================================
3 "Description: Syntax checking plugin for syntastic.vim
4 "Maintainer: Alexis Laferrière <alexis.laf@xymus.net>
5 "License: This program is free software. It comes without any warranty,
6 " to the extent permitted by applicable law. You can redistribute
7 " it and/or modify it under the terms of the Do What The Fuck You
8 " Want To Public License, Version 2, as published by Sam Hocevar.
9 " See http://sam.zoy.org/wtfpl/COPYING for more details.
11 " g:syntastic_nitc specifies custom path to compiler
12 " g:syntastic_nit_dir specifies the NIT_DIR env variable
13 " g:syntastic_nit_args specifies extra arguments to call nitc
14 " g:syntastic_nit_include_dirs lists directories to include, must be a list
15 "============================================================================
16 if exists("loaded_nit_syntax_checker")
19 let loaded_nit_syntax_checker = 1
21 " check if nitc is accessible
22 if exists('g:syntastic_nitc')
23 let s:nitc = g:syntastic_nitc
28 if !executable(s:nitc)
29 if exists('g:syntastic_nitc')
30 echo "Syntastic for Nit error: Custom nitc cannot be found at: " . g:syntastic_nitc
35 function! SyntaxCheckers_nit_GetLocList()
36 let makeprg = s:nitc . " --no-color --only-metamodel 2>&1 " . shellescape(expand("%"))
39 if exists('g:syntastic_nit_dir')
40 let makeprg = "NIT_DIR=" . g:syntastic_nit_dir . " " . makeprg
44 " custom options for nit compiler
45 if exists('g:syntastic_nit_options')
46 let makeprg .= " " . g:syntastic_nit_options
49 " custom dirs to include for compiler
50 if exists('g:syntastic_nit_include_dirs')
51 for d in g:syntastic_nit_include_dirs
52 let makeprg .= " -I " . d
56 " possible combinations of error messages
57 let ef_start = [ '%f:%l\,%c--%*[0-9]:', '%f:%l\,%c--%*[0-9]\,%*[0-9]:', '%f:%l\,%c:' ]
58 let ef_type = [ ' %tarning: ', '' ]
60 " generate errorformat from combinations
64 let errorformat .= s . t . '%m,'
68 return SyntasticMake({ 'makeprg': makeprg, 'errorformat':errorformat })