msidl.vim 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. " Vim syntax file
  2. " Language: MS IDL (Microsoft dialect of Interface Description Language)
  3. " Maintainer: Vadim Zeitlin <vadim@wxwindows.org>
  4. " Last Change: 2012 Feb 12 by Thilo Six
  5. " quit when a syntax file was already loaded
  6. if exists("b:current_syntax")
  7. finish
  8. endif
  9. let s:cpo_save = &cpo
  10. set cpo&vim
  11. " Misc basic
  12. syn match msidlId "[a-zA-Z][a-zA-Z0-9_]*"
  13. syn match msidlUUID "{\?[[:xdigit:]]\{8}-\([[:xdigit:]]\{4}-\)\{3}[[:xdigit:]]\{12}}\?"
  14. syn region msidlString start=/"/ skip=/\\\(\\\\\)*"/ end=/"/
  15. syn match msidlLiteral "\d\+\(\.\d*\)\="
  16. syn match msidlLiteral "\.\d\+"
  17. syn match msidlSpecial contained "[]\[{}:]"
  18. " Comments
  19. syn keyword msidlTodo contained TODO FIXME XXX
  20. syn region msidlComment start="/\*" end="\*/" contains=msidlTodo
  21. syn match msidlComment "//.*" contains=msidlTodo
  22. syn match msidlCommentError "\*/"
  23. " C style Preprocessor
  24. syn region msidlIncluded contained start=+"+ skip=+\\\(\\\\\)*"+ end=+"+
  25. syn match msidlIncluded contained "<[^>]*>"
  26. syn match msidlInclude "^[ \t]*#[ \t]*include\>[ \t]*["<]" contains=msidlIncluded,msidlString
  27. syn region msidlPreCondit start="^[ \t]*#[ \t]*\(if\>\|ifdef\>\|ifndef\>\|elif\>\|else\>\|endif\>\)" skip="\\$" end="$" contains=msidlComment,msidlCommentError
  28. syn region msidlDefine start="^[ \t]*#[ \t]*\(define\>\|undef\>\)" skip="\\$" end="$" contains=msidlLiteral, msidlString
  29. " Attributes
  30. syn keyword msidlAttribute contained in out propget propput propputref retval
  31. syn keyword msidlAttribute contained aggregatable appobject binadable coclass control custom default defaultbind defaultcollelem defaultvalue defaultvtable dispinterface displaybind dual entry helpcontext helpfile helpstring helpstringdll hidden id immediatebind lcid library licensed nonbrowsable noncreatable nonextensible oleautomation optional object public readonly requestedit restricted source string uidefault usesgetlasterror vararg version
  32. syn match msidlAttribute /uuid(.*)/he=s+4 contains=msidlUUID
  33. syn match msidlAttribute /helpstring(.*)/he=s+10 contains=msidlString
  34. syn region msidlAttributes start="\[" end="]" keepend contains=msidlSpecial,msidlString,msidlAttribute,msidlComment,msidlCommentError
  35. " Keywords
  36. syn keyword msidlEnum enum
  37. syn keyword msidlImport import importlib
  38. syn keyword msidlStruct interface library coclass
  39. syn keyword msidlTypedef typedef
  40. " Types
  41. syn keyword msidlStandardType byte char double float hyper int long short void wchar_t
  42. syn keyword msidlStandardType BOOL BSTR HRESULT VARIANT VARIANT_BOOL
  43. syn region msidlSafeArray start="SAFEARRAY(" end=")" contains=msidlStandardType
  44. syn sync lines=50
  45. " Define the default highlighting.
  46. " Only when an item doesn't have highlighting yet
  47. hi def link msidlInclude Include
  48. hi def link msidlPreProc PreProc
  49. hi def link msidlPreCondit PreCondit
  50. hi def link msidlDefine Macro
  51. hi def link msidlIncluded String
  52. hi def link msidlString String
  53. hi def link msidlComment Comment
  54. hi def link msidlTodo Todo
  55. hi def link msidlSpecial SpecialChar
  56. hi def link msidlLiteral Number
  57. hi def link msidlUUID Number
  58. hi def link msidlImport Include
  59. hi def link msidlEnum StorageClass
  60. hi def link msidlStruct Structure
  61. hi def link msidlTypedef Typedef
  62. hi def link msidlAttribute StorageClass
  63. hi def link msidlStandardType Type
  64. hi def link msidlSafeArray Type
  65. let b:current_syntax = "msidl"
  66. let &cpo = s:cpo_save
  67. unlet s:cpo_save
  68. " vi: set ts=8 sw=4: