iasl.vim 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. "============================================================================
  2. "File: iasl.vim
  3. "Description: Syntax checking plugin for syntastic using iasl
  4. "Maintainer: Peter Wu <peter@lekensteyn.nl>
  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. "============================================================================
  11. if exists('g:loaded_syntastic_asl_iasl_checker')
  12. finish
  13. endif
  14. let g:loaded_syntastic_asl_iasl_checker = 1
  15. let s:save_cpo = &cpo
  16. set cpo&vim
  17. function! SyntaxCheckers_asl_iasl_GetLocList() dict
  18. let tmpdir = syntastic#util#tmpdir() . syntastic#util#Slash()
  19. let makeprg = self.makeprgBuild({
  20. \ 'args': '-vi',
  21. \ 'args_after': ['-p', tmpdir] })
  22. let errorformat =
  23. \ '%f(%l) : %trror %n - %m,' .
  24. \ '%f(%l) : %tarning %n - %m,' .
  25. \ '%f(%l) : %temark %n - %m,' .
  26. \ '%f(%l) : %tptimize %n - %m,' .
  27. \ '%f(%l) : %m'
  28. let loclist = SyntasticMake({
  29. \ 'makeprg': makeprg,
  30. \ 'errorformat': errorformat,
  31. \ 'returns': [0, 255] })
  32. for e in loclist
  33. if e['type'] =~? 'r'
  34. let e['type'] = 'W'
  35. elseif e['type'] =~? 'o'
  36. let e['type'] = 'W'
  37. let e['subtype'] = 'Style'
  38. endif
  39. endfor
  40. call syntastic#util#rmrf(tmpdir)
  41. return loclist
  42. endfunction
  43. call g:SyntasticRegistry.CreateAndRegisterChecker({
  44. \ 'filetype': 'asl',
  45. \ 'name': 'iasl'})
  46. let &cpo = s:save_cpo
  47. unlet s:save_cpo
  48. " vim: set sw=4 sts=4 et fdm=marker: