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_syntastic_nit_nitc_checker")
19 let loaded_syntastic_nit_nitc_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_nitc_IsAvailable()
36 return executable(expand(s:nitc))
39 function! SyntaxCheckers_nit_nitc_GetLocList()
40 let makeprg = s:nitc . " --no-color --only-metamodel "
43 if exists('g:syntastic_nit_dir')
44 let makeprg = "NIT_DIR=" . g:syntastic_nit_dir . " " . makeprg
47 " custom options for nit compiler
48 if exists('g:syntastic_nit_options')
49 let makeprg .= " " . g:syntastic_nit_options
52 " custom dirs to include for compiler
53 if exists('g:syntastic_nit_include_dirs')
54 for d in g:syntastic_nit_include_dirs
55 let makeprg .= " -I " . d
59 " alternative main module
60 if exists('g:nit_main')
61 let makeprg .= " " . g:nit_main
63 let makeprg .= " " . shellescape(expand("%"))
67 let makeprg .= " 2>&1 "
69 " possible combinations of error messages
70 let ef_start = [ '%f:%l\,%c--%*[0-9]:',
71 \ '%f:%l\,%c--%*[0-9]\,%*[0-9]:',
73 let ef_type = [ ' %tarning: ',
76 " generate errorformat from combinations
80 let errorformat .= s . t . '%m,'
84 return SyntasticMake({ 'makeprg': makeprg, 'errorformat':errorformat })
87 call g:SyntasticRegistry.CreateAndRegisterChecker({