1 "============================================================================
3 "Description: ActionScript syntax checker - using mxmlc
4 "Maintainer: Andy Earnshaw <andyearnshaw@gmail.com>
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.
10 "============================================================================
12 if exists('g:loaded_syntastic_actionscript_mxmlc_checker')
15 let g:loaded_syntastic_actionscript_mxmlc_checker = 1
17 if !exists('g:syntastic_actionscript_mxmlc_conf')
18 let g:syntastic_actionscript_mxmlc_conf = ''
24 function! SyntaxCheckers_actionscript_mxmlc_GetHighlightRegex(item)
27 if match(a:item['text'], '\mvariable ''') > -1
28 let term = matchstr(a:item['text'], '\m''\zs[^'']\+\ze''')
30 elseif match(a:item['text'], 'expected a definition keyword') > -1
31 let term = matchstr(a:item['text'], '\mnot \zs[^.]\+\ze\.')
33 elseif match(a:item['text'], '\mundefined \%(property\|method\)') > -1
34 let term = matchstr(a:item['text'], '\mundefined \%(property\|method\) \zs[^. ]\+\ze')
36 elseif match(a:item['text'], 'could not be found') > -1
37 let term = matchstr(a:item['text'], '\m \zs\S\+\ze could not be found')
39 elseif match(a:item['text'], 'Type was not found') > -1
40 let term = matchstr(a:item['text'], '\m: \zs[^.]\+\zs\.')
44 return term != '' ? '\V\<' . escape(term, '\') . '\>' : ''
47 function! SyntaxCheckers_actionscript_mxmlc_GetLocList() dict
48 let makeprg = self.makeprgBuild({
49 \ 'args_before': (g:syntastic_actionscript_mxmlc_conf != '' ?
50 \ ' -load-config+=' . g:syntastic_actionscript_mxmlc_conf : ''),
51 \ 'args_after': '-output=' . syntastic#util#DevNull() })
54 \ '%f(%l): col: %c %trror: %m,' .
55 \ '%f(%l): col: %c %tarning: %m,' .
59 return SyntasticMake({
61 \ 'errorformat': errorformat })
64 call g:SyntasticRegistry.CreateAndRegisterChecker({
65 \ 'filetype': 'actionscript',
71 " vim: set et sts=4 sw=4: