7
|
1 " Vim syntax file
|
|
2 " Language: MS IDL (Microsoft dialect of Interface Description Language)
|
|
3 " Maintainer: Vadim Zeitlin <vadim@wxwindows.org>
|
3356
|
4 " Last Change: 2012 Feb 12 by Thilo Six
|
7
|
5
|
|
6 " For version 5.x: Clear all syntax items
|
|
7 " For version 6.x: Quit when a syntax file was already loaded
|
|
8 if version < 600
|
|
9 syntax clear
|
|
10 elseif exists("b:current_syntax")
|
|
11 finish
|
|
12 endif
|
|
13
|
3356
|
14 let s:cpo_save = &cpo
|
|
15 set cpo&vim
|
|
16
|
7
|
17 " Misc basic
|
|
18 syn match msidlId "[a-zA-Z][a-zA-Z0-9_]*"
|
|
19 syn match msidlUUID "{\?[[:xdigit:]]\{8}-\([[:xdigit:]]\{4}-\)\{3}[[:xdigit:]]\{12}}\?"
|
|
20 syn region msidlString start=/"/ skip=/\\\(\\\\\)*"/ end=/"/
|
|
21 syn match msidlLiteral "\d\+\(\.\d*\)\="
|
|
22 syn match msidlLiteral "\.\d\+"
|
|
23 syn match msidlSpecial contained "[]\[{}:]"
|
|
24
|
|
25 " Comments
|
|
26 syn keyword msidlTodo contained TODO FIXME XXX
|
|
27 syn region msidlComment start="/\*" end="\*/" contains=msidlTodo
|
|
28 syn match msidlComment "//.*" contains=msidlTodo
|
|
29 syn match msidlCommentError "\*/"
|
|
30
|
|
31 " C style Preprocessor
|
|
32 syn region msidlIncluded contained start=+"+ skip=+\\\(\\\\\)*"+ end=+"+
|
|
33 syn match msidlIncluded contained "<[^>]*>"
|
|
34 syn match msidlInclude "^[ \t]*#[ \t]*include\>[ \t]*["<]" contains=msidlIncluded,msidlString
|
|
35 syn region msidlPreCondit start="^[ \t]*#[ \t]*\(if\>\|ifdef\>\|ifndef\>\|elif\>\|else\>\|endif\>\)" skip="\\$" end="$" contains=msidlComment,msidlCommentError
|
|
36 syn region msidlDefine start="^[ \t]*#[ \t]*\(define\>\|undef\>\)" skip="\\$" end="$" contains=msidlLiteral, msidlString
|
|
37
|
|
38 " Attributes
|
|
39 syn keyword msidlAttribute contained in out propget propput propputref retval
|
|
40 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
|
|
41 syn match msidlAttribute /uuid(.*)/he=s+4 contains=msidlUUID
|
|
42 syn match msidlAttribute /helpstring(.*)/he=s+10 contains=msidlString
|
|
43 syn region msidlAttributes start="\[" end="]" keepend contains=msidlSpecial,msidlString,msidlAttribute,msidlComment,msidlCommentError
|
|
44
|
|
45 " Keywords
|
|
46 syn keyword msidlEnum enum
|
|
47 syn keyword msidlImport import importlib
|
|
48 syn keyword msidlStruct interface library coclass
|
|
49 syn keyword msidlTypedef typedef
|
|
50
|
|
51 " Types
|
|
52 syn keyword msidlStandardType byte char double float hyper int long short void wchar_t
|
|
53 syn keyword msidlStandardType BOOL BSTR HRESULT VARIANT VARIANT_BOOL
|
|
54 syn region msidlSafeArray start="SAFEARRAY(" end=")" contains=msidlStandardType
|
|
55
|
|
56 syn sync lines=50
|
|
57
|
|
58 " Define the default highlighting.
|
|
59 " For version 5.7 and earlier: only when not done already
|
|
60 " For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
61 if version >= 508 || !exists("did_msidl_syntax_inits")
|
|
62 if version < 508
|
|
63 let did_msidl_syntax_inits = 1
|
|
64 command -nargs=+ HiLink hi link <args>
|
|
65 else
|
|
66 command -nargs=+ HiLink hi def link <args>
|
|
67 endif
|
|
68
|
|
69 HiLink msidlInclude Include
|
|
70 HiLink msidlPreProc PreProc
|
|
71 HiLink msidlPreCondit PreCondit
|
|
72 HiLink msidlDefine Macro
|
|
73 HiLink msidlIncluded String
|
|
74 HiLink msidlString String
|
|
75 HiLink msidlComment Comment
|
|
76 HiLink msidlTodo Todo
|
|
77 HiLink msidlSpecial SpecialChar
|
|
78 HiLink msidlLiteral Number
|
|
79 HiLink msidlUUID Number
|
|
80
|
|
81 HiLink msidlImport Include
|
|
82 HiLink msidlEnum StorageClass
|
|
83 HiLink msidlStruct Structure
|
|
84 HiLink msidlTypedef Typedef
|
|
85 HiLink msidlAttribute StorageClass
|
|
86
|
|
87 HiLink msidlStandardType Type
|
|
88 HiLink msidlSafeArray Type
|
|
89
|
|
90 delcommand HiLink
|
|
91 endif
|
|
92
|
|
93 let b:current_syntax = "msidl"
|
|
94
|
3356
|
95 let &cpo = s:cpo_save
|
|
96 unlet s:cpo_save
|
7
|
97 " vi: set ts=8 sw=4:
|