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