12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- if exists('g:loaded_syntastic_asm_gcc_checker')
- finish
- endif
- let g:loaded_syntastic_asm_gcc_checker = 1
- if !exists('g:syntastic_asm_compiler_options')
- let g:syntastic_asm_compiler_options = ''
- endif
- if !exists('g:syntastic_asm_generic')
- let g:syntastic_asm_generic = 0
- endif
- let s:save_cpo = &cpo
- set cpo&vim
- function! SyntaxCheckers_asm_gcc_IsAvailable() dict " {{{1
- if !exists('g:syntastic_asm_compiler')
- let g:syntastic_asm_compiler = self.getExec()
- endif
- return executable(expand(g:syntastic_asm_compiler, 1))
- endfunction
- function! SyntaxCheckers_asm_gcc_GetLocList() dict " {{{1
- return syntastic#c#GetLocList('asm', 'gcc', {
- \ 'errorformat':
- \ '%-G%f:%s:,' .
- \ '%f:%l:%c: %trror: %m,' .
- \ '%f:%l:%c: %tarning: %m,' .
- \ '%f:%l: %m',
- \ 'main_flags': '-x assembler -fsyntax-only' . (g:syntastic_asm_generic ? '' : ' -masm=' . s:GetDialect()) })
- endfunction
- function! s:GetDialect() " {{{2
- return syntastic#util#var('asm_dialect', expand('%:e', 1) ==? 'asm' ? 'intel' : 'att')
- endfunction
- call g:SyntasticRegistry.CreateAndRegisterChecker({
- \ 'filetype': 'asm',
- \ 'name': 'gcc' })
- let &cpo = s:save_cpo
- unlet s:save_cpo
|