5ac60da7593886087769a08c7c72a4f75a44cb57
[nit.git] / misc / syntastic / nit.vim
1 "============================================================================
2 "File:        nit.vim
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.
10 "============================================================================
11 if exists("loaded_nit_syntax_checker")
12         finish
13 endif
14 let loaded_nit_syntax_checker = 1
15
16 " check if nitc is accessible
17 if !executable("nitc")
18         finish
19 endif
20
21 function! SyntaxCheckers_nit_GetLocList()
22         let makeprg = "nitc --no-color --only-metamodel 2>&1 " . shellescape(expand("%"))
23         let errorformat =
24                 \'%f:%l\,%c--%*[0-9]: %m,
25                 \%f:%l\,%c--%*[0-9]\,0: %m,
26                 \%f:%l\,%c: %m'
27         return SyntasticMake({ 'makeprg': makeprg, 'errorformat':errorformat })
28 endfunction