blob: 3bf5940a81e540f864e4afb797797fc5dd0c487c [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
57command -nargs=+ HiLink hi def link <args>
Bram Moolenaar071d4272004-06-13 20:20:40 +000058
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020059HiLink msidlInclude Include
60HiLink msidlPreProc PreProc
61HiLink msidlPreCondit PreCondit
62HiLink msidlDefine Macro
63HiLink msidlIncluded String
64HiLink msidlString String
65HiLink msidlComment Comment
66HiLink msidlTodo Todo
67HiLink msidlSpecial SpecialChar
68HiLink msidlLiteral Number
69HiLink msidlUUID Number
Bram Moolenaar071d4272004-06-13 20:20:40 +000070
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020071HiLink msidlImport Include
72HiLink msidlEnum StorageClass
73HiLink msidlStruct Structure
74HiLink msidlTypedef Typedef
75HiLink msidlAttribute StorageClass
Bram Moolenaar071d4272004-06-13 20:20:40 +000076
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020077HiLink msidlStandardType Type
78HiLink msidlSafeArray Type
Bram Moolenaar071d4272004-06-13 20:20:40 +000079
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020080delcommand HiLink
Bram Moolenaar071d4272004-06-13 20:20:40 +000081
82let b:current_syntax = "msidl"
83
Bram Moolenaar5dc62522012-02-13 00:05:22 +010084let &cpo = s:cpo_save
85unlet s:cpo_save
Bram Moolenaar071d4272004-06-13 20:20:40 +000086" vi: set ts=8 sw=4: