msidl.vim (3464B)
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 6 " quit when a syntax file was already loaded 7 if exists("b:current_syntax") 8 finish 9 endif 10 11 let s:cpo_save = &cpo 12 set cpo&vim 13 14 " Misc basic 15 syn match msidlId "[a-zA-Z][a-zA-Z0-9_]*" 16 syn match msidlUUID "{\?[[:xdigit:]]\{8}-\([[:xdigit:]]\{4}-\)\{3}[[:xdigit:]]\{12}}\?" 17 syn region msidlString start=/"/ skip=/\\\(\\\\\)*"/ end=/"/ 18 syn match msidlLiteral "\d\+\(\.\d*\)\=" 19 syn match msidlLiteral "\.\d\+" 20 syn match msidlSpecial contained "[]\[{}:]" 21 22 " Comments 23 syn keyword msidlTodo contained TODO FIXME XXX 24 syn region msidlComment start="/\*" end="\*/" contains=msidlTodo 25 syn match msidlComment "//.*" contains=msidlTodo 26 syn match msidlCommentError "\*/" 27 28 " C style Preprocessor 29 syn region msidlIncluded contained start=+"+ skip=+\\\(\\\\\)*"+ end=+"+ 30 syn match msidlIncluded contained "<[^>]*>" 31 syn match msidlInclude "^[ \t]*#[ \t]*include\>[ \t]*["<]" contains=msidlIncluded,msidlString 32 syn region msidlPreCondit start="^[ \t]*#[ \t]*\(if\>\|ifdef\>\|ifndef\>\|elif\>\|else\>\|endif\>\)" skip="\\$" end="$" contains=msidlComment,msidlCommentError 33 syn region msidlDefine start="^[ \t]*#[ \t]*\(define\>\|undef\>\)" skip="\\$" end="$" contains=msidlLiteral, msidlString 34 35 " Attributes 36 syn keyword msidlAttribute contained in out propget propput propputref retval 37 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 38 syn match msidlAttribute /uuid(.*)/he=s+4 contains=msidlUUID 39 syn match msidlAttribute /helpstring(.*)/he=s+10 contains=msidlString 40 syn region msidlAttributes start="\[" end="]" keepend contains=msidlSpecial,msidlString,msidlAttribute,msidlComment,msidlCommentError 41 42 " Keywords 43 syn keyword msidlEnum enum 44 syn keyword msidlImport import importlib 45 syn keyword msidlStruct interface library coclass 46 syn keyword msidlTypedef typedef 47 48 " Types 49 syn keyword msidlStandardType byte char double float hyper int long short void wchar_t 50 syn keyword msidlStandardType BOOL BSTR HRESULT VARIANT VARIANT_BOOL 51 syn region msidlSafeArray start="SAFEARRAY(" end=")" contains=msidlStandardType 52 53 syn sync lines=50 54 55 " Define the default highlighting. 56 " Only when an item doesn't have highlighting yet 57 58 hi def link msidlInclude Include 59 hi def link msidlPreProc PreProc 60 hi def link msidlPreCondit PreCondit 61 hi def link msidlDefine Macro 62 hi def link msidlIncluded String 63 hi def link msidlString String 64 hi def link msidlComment Comment 65 hi def link msidlTodo Todo 66 hi def link msidlSpecial SpecialChar 67 hi def link msidlLiteral Number 68 hi def link msidlUUID Number 69 70 hi def link msidlImport Include 71 hi def link msidlEnum StorageClass 72 hi def link msidlStruct Structure 73 hi def link msidlTypedef Typedef 74 hi def link msidlAttribute StorageClass 75 76 hi def link msidlStandardType Type 77 hi def link msidlSafeArray Type 78 79 80 let b:current_syntax = "msidl" 81 82 let &cpo = s:cpo_save 83 unlet s:cpo_save 84 " vi: set ts=8 sw=4: