Cleanup mxmlc checker.

This commit is contained in:
LCD 47 2013-12-21 09:59:20 +02:00
parent 7b29bea72d
commit 9cef2f5ed4

View File

@ -24,20 +24,20 @@ endif
function! SyntaxCheckers_actionscript_mxmlc_GetHighlightRegex(item) function! SyntaxCheckers_actionscript_mxmlc_GetHighlightRegex(item)
let term = '' let term = ''
if match(a:item['text'], "variable '") > -1 if match(a:item['text'], '\mvariable ''') > -1
let term = split(a:item['text'], "'")[1] let term = matchstr(a:item['text'], '\m''\zs[^'']\+\ze''')
elseif match(a:item['text'], 'expected a definition keyword') > -1 elseif match(a:item['text'], 'expected a definition keyword') > -1
let term = matchlist(a:item['text'], 'not \([^\.]\+\)\.')[1] let term = matchstr(a:item['text'], '\mnot \zs[^.]\+\ze\.')
elseif match(a:item['text'], 'undefined \%(property\|method\)') > -1 elseif match(a:item['text'], '\mundefined \%(property\|method\)') > -1
let term = matchlist(a:item['text'], 'undefined \%(property\|method\) \([^\. ]\+\)')[1] let term = matchstr(a:item['text'], '\mundefined \%(property\|method\) \zs[^. ]\+\ze')
elseif match(a:item['text'], 'could not be found') > -1 elseif match(a:item['text'], 'could not be found') > -1
let term = matchlist(a:item['text'], ' \([^ ]\+\) could not be found')[1] let term = matchstr(a:item['text'], '\m \zs\S\+\ze could not be found')
elseif match(a:item['text'], 'Type was not found') > -1 elseif match(a:item['text'], 'Type was not found') > -1
let term = matchlist(a:item['text'], ': \([^\.]\+\)\.')[1] let term = matchstr(a:item['text'], '\m: \zs[^.]\+\zs\.')
endif endif
@ -45,18 +45,19 @@ function! SyntaxCheckers_actionscript_mxmlc_GetHighlightRegex(item)
endfunction endfunction
function! SyntaxCheckers_actionscript_mxmlc_GetLocList() dict function! SyntaxCheckers_actionscript_mxmlc_GetLocList() dict
let output = has("win32") ? 'NUL' : '/dev/null' let makeprg = self.makeprgBuild({
let makeprg = self.makeprgBuild({ 'args': '-output=' . output . s:Args() }) \ 'args': '-output=' . syntastic#util#DevNull() .
\ !empty(g:syntastic_actionscript_mxmlc_conf) ?
\ ' -load-config+=' . g:syntastic_actionscript_mxmlc_conf : '' })
let errorformat = let errorformat =
\ '%f(%l): col: %c %trror: %m,' . \ '%f(%l): col: %c %trror: %m,' .
\ '%f(%l): col: %c %tarning: %m,' \ '%f(%l): col: %c %tarning: %m,' .
\ '%-G%.%#'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) return SyntasticMake({
endfunction \ 'makeprg': makeprg,
\ 'errorformat': errorformat })
function s:Args()
return !empty(g:syntastic_actionscript_mxmlc_conf) ? ' -load-config+=' . g:syntastic_actionscript_mxmlc_conf : ''
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({