xref: /vim-8.2.3635/runtime/syntax/msidl.vim (revision f37506f6)
1" Vim syntax file
2" Language:     MS IDL (Microsoft dialect of Interface Description Language)
3" Maintainer:   Vadim Zeitlin <[email protected]>
4" Last Change:  2012 Feb 12 by Thilo Six
5
6" quit when a syntax file was already loaded
7if exists("b:current_syntax")
8  finish
9endif
10
11let s:cpo_save = &cpo
12set cpo&vim
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" Only when an item doesn't have highlighting yet
57
58hi 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
69
70hi def link msidlImport		Include
71hi def link msidlEnum		StorageClass
72hi def link msidlStruct		Structure
73hi def link msidlTypedef		Typedef
74hi def link msidlAttribute		StorageClass
75
76hi def link msidlStandardType	Type
77hi def link msidlSafeArray		Type
78
79
80let b:current_syntax = "msidl"
81
82let &cpo = s:cpo_save
83unlet s:cpo_save
84" vi: set ts=8 sw=4:
85