summaryrefslogtreecommitdiff
path: root/.config/vim/compiler/mlint.vim
blob: f9e9c6dd3ffea6ea54bcf3a6b87bbaa8630913ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
" Vim compiler file
" Compiler:         Matlab mlint code checker
" Maintainer:       Fabrice Guy <fabrice.guy at gmail dot com>
" Latest Revision:  2008 Oct 16
" Comment:          mlint messages are either 
"                   - L x (C y): message (where x and y are line number and
"                   column number)
"                   - L x (C y-z): message (where x is the line number, y and
"                   z the column numbers where the error comes from)


if exists("current_compiler")
  finish
endif
let current_compiler = "mlint"

if exists(":CompilerSet") != 2		" older Vim always used :setlocal
  command -nargs=* CompilerSet setlocal <args>
endif

" mlint doesn't provide filename information except if multiple
" filenames are given 
" With the following command :
" mlint <filename> <filename without extension>
" mlint produces an output like that :
" ========== <filename> ==========
" L x (C y): ID : Message
" L x (C y): ID : Message
" ..
" ..
" ========== <filename without extension> ==========
" L 0 (C 0): MDOTM :Filename 'filename' must end in .m or .M
"
" The filename can then be parsed
CompilerSet makeprg=mlint\ -id\ %\ %< 

CompilerSet errorformat=
      \%-P==========\ %f\ ==========,
      \%-G%>==========\ %s\ ==========,
      \%-G%>L\ %l\ (C\ %c):\ MDOTM%m,
      \L\ %l\ (C\ %c):\ %m,
      \L\ %l\ (C\ %c-%*[0-9]):\ %m,
      \%-Q