blob: 57eaecaa4f6d9132fafc216e83ef354945c36fe4 [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>
Bram Moolenaar5dc62522012-02-13 00:05:22 +01004" Last Change: 2012 Feb 12 by Thilo Six
Bram Moolenaar071d4272004-06-13 20:20:40 +00005
Bram Moolenaar89bcfda2016-08-30 23:26:57 +02006" quit when a syntax file was already loaded
7if exists("b:current_syntax")
Bram Moolenaar071d4272004-06-13 20:20:40 +00008 finish
9endif
10
Bram Moolenaar5dc62522012-02-13 00:05:22 +010011let s:cpo_save = &cpo
12set cpo&vim
13
Bram Moolenaar071d4272004-06-13 20:20:40 +000014" 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.
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020056" Only when an item doesn't have highlighting yet
Bram Moolenaar071d4272004-06-13 20:20:40 +000057
Bram Moolenaarf37506f2016-08-31 22:22:10 +020058hi def link msidlInclude Include
59hi def link msidlPreProc PreProc
60hi def link msidlPreCondit PreCondit
61hi def link msidlDefine Macro
62hi def link msidlIncluded String
63hi def link msidlString String
64hi def link msidlComment Comment
65hi def link msidlTodo Todo
66hi def link msidlSpecial SpecialChar
67hi def link msidlLiteral Number
68hi def link msidlUUID Number
Bram Moolenaar071d4272004-06-13 20:20:40 +000069
Bram Moolenaarf37506f2016-08-31 22:22:10 +020070hi def link msidlImport Include
71hi def link msidlEnum StorageClass
72hi def link msidlStruct Structure
73hi def link msidlTypedef Typedef
74hi def link msidlAttribute StorageClass
Bram Moolenaar071d4272004-06-13 20:20:40 +000075
Bram Moolenaarf37506f2016-08-31 22:22:10 +020076hi def link msidlStandardType Type
77hi def link msidlSafeArray Type
Bram Moolenaar071d4272004-06-13 20:20:40 +000078
Bram Moolenaar071d4272004-06-13 20:20:40 +000079
80let b:current_syntax = "msidl"
81
Bram Moolenaar5dc62522012-02-13 00:05:22 +010082let &cpo = s:cpo_save
83unlet s:cpo_save
Bram Moolenaar071d4272004-06-13 20:20:40 +000084" vi: set ts=8 sw=4: