OClint: fix parsing.

This commit is contained in:
LCD 47 2014-08-15 08:23:49 +03:00
parent f62e0f6618
commit 1fac6011ef
2 changed files with 11 additions and 4 deletions

View File

@ -19,7 +19,7 @@ if has('reltime')
lockvar! g:syntastic_start
endif
let g:syntastic_version = '3.4.0-117'
let g:syntastic_version = '3.4.0-120'
lockvar g:syntastic_version
" Sanity checks {{{1

View File

@ -33,12 +33,10 @@ function! SyntaxCheckers_c_oclint_GetLocList() dict
\ 'post_args_before': '-- -c ' . syntastic#c#ReadConfig(g:syntastic_oclint_config_file) })
let errorformat =
\ '%E%f:%l:%c: %m P1 ,' .
\ '%E%f:%l:%c: %m P2 ,' .
\ '%W%f:%l:%c: %m P3 ,' .
\ '%E%f:%l:%c: fatal error: %m,' .
\ '%E%f:%l:%c: error: %m,' .
\ '%W%f:%l:%c: warning: %m,' .
\ '%E%f:%l:%c: %m,' .
\ '%-G%.%#'
let loclist = SyntasticMake({
@ -48,6 +46,15 @@ function! SyntaxCheckers_c_oclint_GetLocList() dict
\ 'postprocess': ['compressWhitespace'],
\ 'returns': [0, 3, 5] })
for e in loclist
if e['text'] =~# '\v P3( |$)'
let e['type'] = 'W'
endif
let e['text'] = substitute(e['text'], '\m P[1-3]$', '', '')
let e['text'] = substitute(e['text'], ' P[1-3] ', ': ', '')
endfor
call self.setWantSort(1)
return loclist