Cleanup: asm/gcc checker.

This commit is contained in:
LCD 47 2014-02-08 09:32:44 +02:00
parent 0eed307fdb
commit 4def389ae4
2 changed files with 13 additions and 28 deletions

View File

@ -35,10 +35,10 @@ the user is notified and is happy because they didn't have to compile their
code or execute their script to find them.
At the time of this writing, syntax checking plugins exist for ActionScript,
Ada, AppleScript, AsciiDoc, BEMHTML, Bourne shell, C, C++, C#, Chef,
CoffeeScript, Coco, Coq, CSS, Cucumber, CUDA, D, Dart, DocBook, Dust,
Elixir, Erlang, eRuby, Fortran, Gentoo metadata, GLSL, Go, Haml, Haskell,
Haxe, Handlebars, HSS, HTML, Java, JavaScript, JSON, LESS, Lex, Limbo, LISP,
Ada, AppleScript, AsciiDoc, ASM, BEMHTML, Bourne shell, C, C++, C#, Chef,
CoffeeScript, Coco, Coq, CSS, Cucumber, CUDA, D, Dart, DocBook, Dust, Elixir,
Erlang, eRuby, Fortran, Gentoo metadata, GLSL, Go, Haml, Haskell, Haxe,
Handlebars, HSS, HTML, Java, JavaScript, JSON, LESS, Lex, Limbo, LISP,
LLVM intermediate language, Lua, MATLAB, NASM, Objective-C, Objective-C++,
OCaml, Perl, Perl POD, PHP, gettext Portable Object, Puppet, Python, Racket,
reStructuredText, Ruby, Rust, SASS/SCSS, Scala, Slim, Tcl, TeX, Texinfo, Twig,

View File

@ -15,53 +15,38 @@ if exists('g:loaded_syntastic_asm_gcc_checker')
endif
let g:loaded_syntastic_asm_gcc_checker = 1
let s:asm_extensions = {
\ 's': 'att',
\ 'asm': 'intel'
\ }
if !exists('g:syntastic_asm_compiler')
let g:syntastic_asm_compiler = 'gcc'
if !exists('g:syntastic_asm_compiler_options')
let g:syntastic_asm_compiler_options = ''
endif
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_asm_gcc_IsAvailable() dict
if !exists('g:syntastic_asm_compiler')
let g:syntastic_asm_compiler = self.getExec()
endif
return executable(expand(g:syntastic_asm_compiler))
endfunction
if !exists('g:syntastic_asm_options')
let g:syntastic_asm_options = ''
endif
function! SyntaxCheckers_asm_gcc_GetLocList() dict
let compiler_options = s:GetDialect() . ' ' . g:syntastic_asm_options
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 -masm=' . compiler_options , })
\ 'main_flags': '-x assembler -fsyntax-only -masm=' . s:GetDialect() })
endfunction
function! s:GetDialect()
if exists('g:syntastic_asm_dialect')
return g:syntastic_asm_dialect
endif
let extensions = exists('g:syntastic_asm_extensions')
\ ? g:syntastic_asm_extensions : s:asm_extensions
let dialect = get( extensions, tolower(expand('%:e')), 'att' )
return dialect
return exists('g:syntastic_asm_dialect') ? g:syntastic_asm_dialect :
\ expand('%:e') ==? 'asm' ? 'intel' : 'att'
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'asm',
\ 'name': 'gcc'})
\ 'name': 'gcc' })
let &cpo = s:save_cpo
unlet s:save_cpo