gcc.vim 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. "============================================================================
  2. "File: ada.vim
  3. "Description: Syntax checking plugin for syntastic.vim
  4. "Maintainer: Alfredo Di Napoli <alfredo.dinapoli@gmail.com>
  5. "License: This program is free software. It comes without any warranty,
  6. " to the extent permitted by applicable law.
  7. "
  8. "============================================================================
  9. if exists('g:loaded_syntastic_ada_gcc_checker')
  10. finish
  11. endif
  12. let g:loaded_syntastic_ada_gcc_checker = 1
  13. if !exists('g:syntastic_ada_compiler_options')
  14. let g:syntastic_ada_compiler_options = ''
  15. endif
  16. let s:save_cpo = &cpo
  17. set cpo&vim
  18. function! SyntaxCheckers_ada_gcc_IsAvailable() dict
  19. if !exists('g:syntastic_ada_compiler')
  20. let g:syntastic_ada_compiler = self.getExec()
  21. endif
  22. return executable(expand(g:syntastic_ada_compiler, 1))
  23. endfunction
  24. function! SyntaxCheckers_ada_gcc_GetLocList() dict
  25. return syntastic#c#GetLocList('ada', 'gcc', {
  26. \ 'errorformat':
  27. \ '%-G%f:%s:,' .
  28. \ '%f:%l:%c: %m,' .
  29. \ '%f:%l: %m',
  30. \ 'main_flags': '-c -x ada -gnats -gnatef',
  31. \ 'header_flags': '-x ada -gnats -gnatef',
  32. \ 'header_names': '\.ads$' })
  33. endfunction
  34. call g:SyntasticRegistry.CreateAndRegisterChecker({
  35. \ 'filetype': 'ada',
  36. \ 'name': 'gcc' })
  37. let &cpo = s:save_cpo
  38. unlet s:save_cpo
  39. " vim: set sw=4 sts=4 et fdm=marker: