diff --git a/autoload/syntastic/preprocess.vim b/autoload/syntastic/preprocess.vim index 13b97a84..9ddbddcd 100644 --- a/autoload/syntastic/preprocess.vim +++ b/autoload/syntastic/preprocess.vim @@ -8,6 +8,28 @@ set cpo&vim " Public functions {{{1 +function! syntastic#preprocess#basex(errors) abort " {{{2a + let out = [] + let idx = 0 + while idx < len(a:errors) + let parts = matchlist(a:errors[idx], '\v^\[\S+\] Stopped at (.+), (\d+)/(\d+):') + if len(parts) > 3 + let err = parts[1] . ':' . parts[2] . ':' . parts[3] . ':' + let parts = matchlist(a:errors[idx+1], '\v^\[(.)\D+(\d+)\] (.+)') + if len(parts) > 3 + let err .= (parts[1] ==? 'W' || parts[1] ==? 'E' ? parts[1] : 'E') . ':' . parts[2] . ':' . parts[3] + call add(out, err) + let idx +=1 + endif + elseif a:errors[idx] =~# '\m^\[' + " unparseable errors + call add(out, a:errors[idx]) + endif + let idx +=1 + endwhile + return out +endfunction " }}}2 + function! syntastic#preprocess#cabal(errors) abort " {{{2 let out = [] let star = 0 diff --git a/plugin/syntastic.vim b/plugin/syntastic.vim index 4dba2560..26aa7b28 100644 --- a/plugin/syntastic.vim +++ b/plugin/syntastic.vim @@ -19,7 +19,7 @@ if has('reltime') lockvar! g:_SYNTASTIC_START endif -let g:_SYNTASTIC_VERSION = '3.7.0-9' +let g:_SYNTASTIC_VERSION = '3.7.0-10' lockvar g:_SYNTASTIC_VERSION " Sanity checks {{{1 diff --git a/syntax_checkers/xquery/basex.vim b/syntax_checkers/xquery/basex.vim index 0298bfa5..640a1910 100644 --- a/syntax_checkers/xquery/basex.vim +++ b/syntax_checkers/xquery/basex.vim @@ -20,17 +20,17 @@ set cpo&vim function! SyntaxCheckers_xquery_basex_GetLocList() dict let makeprg = self.makeprgBuild({ \ 'args_after': '-z', - \ 'fname': ['-q', "inspect:module('" . expand('%:p', 1) . "')"] }) + \ 'fname_before': '-q', + \ 'fname': syntastic#util#shescape('inspect:module("' . escape(expand('%:p', 1), '"') . '")') }) let errorformat = - \ '%-GStopped at %\%.\, %l/%c:,'. - \ '%A[%.%#] Stopped at %f\, %l/%c:,'. - \ '%Z[%t%\D%#%n] %m' + \ '%f:%l:%c:%t:%n:%m,' . + \ '%m' let loclist = SyntasticMake({ \ 'makeprg': makeprg, \ 'errorformat': errorformat, - \ 'postprocess': ['compressWhitespace'] }) + \ 'preprocess': 'basex' }) for e in loclist if e['type'] !=# 'W' && e['type'] !=# 'E'