Mercurial > vim
comparison runtime/syntax/idl.vim @ 20:4ac1dce8dd5e v7.0012
updated for version 7.0012
author | vimboss |
---|---|
date | Mon, 26 Jul 2004 12:53:41 +0000 |
parents | 3ba373b54370 |
children | dc8197342755 |
comparison
equal
deleted
inserted
replaced
19:a81bc802c17c | 20:4ac1dce8dd5e |
---|---|
1 " Vim syntax file | 1 " Vim syntax file |
2 " Language: IDL (Interface Description Language) | 2 " Language: IDL (Interface Description Language) |
3 " Maintainer: Jody Goldberg <jgoldberg@home.com> or <jody@gnome.org> | 3 " Created By: Jody Goldberg <jody@gnome.org> |
4 " Last Change: 2004 Jul 12 | 4 " Maintainer: Michael Geddes <michaelrgeddes@optushome.com.au> |
5 " Last Change: 2004 Jul 20 | |
5 | 6 |
6 " This is an experiment. IDL's structure is simple enough to permit a full | 7 " This is an experiment. IDL's structure is simple enough to permit a full |
7 " grammar based approach to rather than using a few heuristics. The result | 8 " grammar based approach to rather than using a few heuristics. The result |
8 " is large and somewhat repetative but seems to work. | 9 " is large and somewhat repetative but seems to work. |
9 | 10 |
10 " For version 5.x: Clear all syntax items | 11 " There are some Microsoft extensions to idl files that are here. Some of |
11 " For version 6.x: Quit when a syntax file was already loaded | 12 " them are disabled by defining idl_no_ms_extensions. |
12 if version < 600 | 13 " |
13 syntax clear | 14 " The more complex of the extensions are disabled by defining idl_no_extensions. |
14 elseif exists("b:current_syntax") | 15 " |
16 | |
17 if exists("b:current_syntax") | |
15 finish | 18 finish |
16 endif | 19 endif |
17 | 20 |
21 if exists("idlsyntax_showerror") | |
22 syn match idlError +\S+ skipwhite skipempty nextgroup=idlError | |
23 endif | |
24 | |
25 syn region idlCppQuote start='\<cpp_quote\s*(' end=')' contains=idlString | |
26 | |
18 " Misc basic | 27 " Misc basic |
19 syn match idlId contained "[a-zA-Z][a-zA-Z0-9_]*" | 28 syn match idlId contained "[a-zA-Z][a-zA-Z0-9_]*" skipwhite skipempty nextgroup=idlEnumComma,idlEnumNumber |
20 syn match idlSemiColon contained ";" | 29 syn match idlEnumComma contained "," |
21 syn match idlCommaArg contained "," skipempty skipwhite nextgroup=idlSimpDecl | 30 syn match idlEnumNumber contained "=" skipwhite skipempty nextgroup=idlString,idlLiteral |
22 syn region idlArraySize1 contained start=:\[: end=:\]: skipempty skipwhite nextgroup=idlArraySize1,idlSemiColon,idlCommaArg contains=idlArraySize1,idlLiteral | 31 syn match idlSemiColon contained ";" |
23 syn match idlSimpDecl contained "[a-zA-Z][a-zA-Z0-9_]*" skipempty skipwhite nextgroup=idlSemiColon,idlCommaArg,idlArraySize1 | 32 syn match idlCommaArg contained "," skipempty skipwhite nextgroup=idlSimpDecl |
24 syn region idlSting contained start=+"+ skip=+\\\(\\\\\)*"+ end=+"+ | 33 syn region idlArraySize1 contained start=:\[: end=:\]: skipempty skipwhite nextgroup=idlArraySize1,idlError,idlSemiColon,idlCommaArg contains=idlArraySize1,idlLiteral |
25 syn match idlLiteral contained "[1-9]\d*\(\.\d*\)\=" | 34 syn match idlSimpDecl contained "[a-zA-Z][a-zA-Z0-9_]*" skipempty skipwhite nextgroup=idlError,idlSemiColon,idlCommaArg,idlArraySize1 |
26 syn match idlLiteral contained "\.\d\+" | 35 syn region idlString contained start=+"+ skip=+\\\(\\\\\)*"+ end=+"+ |
27 syn keyword idlLiteral contained TRUE FALSE | 36 syn match idlLiteral contained "[1-9]\d*\(\.\d*\)\=" |
37 syn match idlLiteral contained "0" | |
38 syn match idlLiteral contained "\.\d\+" | |
39 syn match idlLiteral contained "0x[0-9A-Fa-f]\+" | |
40 syn match idlLiteral contained "0[0-7]\+" | |
41 syn keyword idlLiteral contained TRUE FALSE | |
28 | 42 |
29 " Comments | 43 " Comments |
30 syn keyword idlTodo contained TODO FIXME XXX | 44 syn keyword idlTodo contained TODO FIXME XXX |
31 syn region idlComment start="/\*" end="\*/" contains=idlTodo | 45 syn region idlComment start="/\*" end="\*/" contains=idlTodo |
32 syn match idlComment "//.*" contains=idlTodo | 46 syn match idlComment "//.*" contains=idlTodo |
33 syn match idlCommentError "\*/" | 47 syn match idlCommentError "\*/" |
34 | 48 |
35 " C style Preprocessor | 49 " C style Preprocessor |
36 syn region idlIncluded contained start=+"+ skip=+\\\(\\\\\)*"+ end=+"+ | 50 syn region idlIncluded contained start=+"+ skip=+\\\(\\\\\)*"+ end=+"+ |
37 syn match idlIncluded contained "<[^>]*>" | 51 syn match idlIncluded contained "<[^>]*>" |
38 syn match idlInclude "^[ \t]*#[ \t]*include\>[ \t]*["<]" contains=idlIncluded,idlString | 52 syn match idlInclude "^[ \t]*#[ \t]*include\>[ \t]*["<]" contains=idlIncluded,idlString |
39 syn region idlPreCondit start="^[ \t]*#[ \t]*\(if\>\|ifdef\>\|ifndef\>\|elif\>\|else\>\|endif\>\)" skip="\\$" end="$" contains=idlComment,idlCommentError | 53 syn region idlPreCondit start="^[ \t]*#[ \t]*\(if\>\|ifdef\>\|ifndef\>\|elif\>\|else\>\|endif\>\)" skip="\\$" end="$" contains=idlComment,idlCommentError |
40 syn region idlDefine start="^[ \t]*#[ \t]*\(define\>\|undef\>\)" skip="\\$" end="$" contains=idlLiteral, idlString | 54 syn region idlDefine start="^[ \t]*#[ \t]*\(define\>\|undef\>\)" skip="\\$" end="$" contains=idlLiteral,idlString |
41 | 55 |
42 " Constants | 56 " Constants |
43 syn keyword idlConst const skipempty skipwhite nextgroup=idlBaseType,idlBaseTypeInt | 57 syn keyword idlConst const skipempty skipwhite nextgroup=idlBaseType,idlBaseTypeInt |
44 | 58 |
45 " Attribute | 59 " Attribute |
46 syn keyword idlROAttr readonly skipempty skipwhite nextgroup=idlAttr | 60 syn keyword idlROAttr readonly skipempty skipwhite nextgroup=idlAttr |
47 syn keyword idlAttr attribute skipempty skipwhite nextgroup=idlBaseTypeInt,idlBaseType | 61 syn keyword idlAttr attribute skipempty skipwhite nextgroup=idlBaseTypeInt,idlBaseType |
48 | 62 |
49 " Types | 63 " Types |
50 syn region idlD4 contained start="<" end=">" skipempty skipwhite nextgroup=idlSimpDecl contains=idlSeqType,idlBaseTypeInt,idlBaseType,idlLiteral | 64 syn region idlD4 contained start="<" end=">" skipempty skipwhite nextgroup=idlSimpDecl contains=idlSeqType,idlBaseTypeInt,idlBaseType,idlLiteral |
51 syn keyword idlSeqType contained sequence skipempty skipwhite nextgroup=idlD4 | 65 syn keyword idlSeqType contained sequence skipempty skipwhite nextgroup=idlD4 |
52 syn keyword idlBaseType contained float double char boolean octet any skipempty skipwhite nextgroup=idlSimpDecl | 66 syn keyword idlBaseType contained float double char boolean octet any skipempty skipwhite nextgroup=idlSimpDecl |
53 syn keyword idlBaseTypeInt contained short long skipempty skipwhite nextgroup=idlSimpDecl | 67 syn keyword idlBaseTypeInt contained short long skipempty skipwhite nextgroup=idlSimpDecl |
54 syn keyword idlBaseType contained unsigned skipempty skipwhite nextgroup=idlBaseTypeInt | 68 syn keyword idlBaseType contained unsigned skipempty skipwhite nextgroup=idlBaseTypeInt |
55 syn region idlD1 contained start="<" end=">" skipempty skipwhite nextgroup=idlSimpDecl contains=idlString,idlLiteral | 69 syn region idlD1 contained start="<" end=">" skipempty skipwhite nextgroup=idlSimpDecl contains=idlString,idlLiteral |
56 syn keyword idlBaseType contained string skipempty skipwhite nextgroup=idlD1,idlSimpDecl | 70 syn keyword idlBaseType contained string skipempty skipwhite nextgroup=idlD1,idlSimpDecl |
57 syn match idlBaseType contained "[a-zA-Z0-9_]\+[ \t]*\(::[ \t]*[a-zA-Z0-9_]\+\)*" skipempty skipwhite nextgroup=idlSimpDecl | 71 syn match idlBaseType contained "[a-zA-Z0-9_]\+[ \t]*\(::[ \t]*[a-zA-Z0-9_]\+\)*" skipempty skipwhite nextgroup=idlSimpDecl |
58 | 72 |
59 " Modules | 73 " Modules |
60 syn region idlModuleContent contained start="{" end="}" skipempty skipwhite nextgroup=idlSemiColon contains=idlUnion,idlStruct,idlEnum,idlInterface,idlComment,idlTypedef,idlConst,idlException,idlModule | 74 syn region idlModuleContent contained start="{" end="}" skipempty skipwhite nextgroup=idlError,idlSemiColon contains=idlUnion,idlStruct,idlEnum,idlInterface,idlComment,idlTypedef,idlConst,idlException,idlModule |
61 syn match idlModuleName contained "[a-zA-Z0-9_]\+" skipempty skipwhite nextgroup=idlModuleContent,idlSemiColon | 75 syn match idlModuleName contained "[a-zA-Z0-9_]\+" skipempty skipwhite nextgroup=idlModuleContent,idlError,idlSemiColon |
62 syn keyword idlModule module skipempty skipwhite nextgroup=idlModuleName | 76 syn keyword idlModule module skipempty skipwhite nextgroup=idlModuleName |
63 | 77 |
64 " Interfaces | 78 " Interfaces |
65 syn region idlInterfaceContent contained start="{" end="}" skipempty skipwhite nextgroup=idlSemiColon contains=idlUnion,idlStruct,idlEnum,idlComment,idlROAttr,idlAttr,idlOp,idlOneWayOp,idlException,idlConst,idlTypedef | 79 syn cluster idlCommentable contains=idlComment |
66 syn match idlInheritFrom2 contained "," skipempty skipwhite nextgroup=idlInheritFrom | 80 syn cluster idlContentCluster contains=idlUnion,idlStruct,idlEnum,idlROAttr,idlAttr,idlOp,idlOneWayOp,idlException,idlConst,idlTypedef,idlAttributes,idlErrorSquareBracket,idlErrorBracket,idlInterfaceSections |
67 syn match idlInheritFrom contained "[a-zA-Z0-9_]\+[ \t]*\(::[ \t]*[a-zA-Z0-9_]\+\)*" skipempty skipwhite nextgroup=idlInheritFrom2,idlInterfaceContent | 81 |
68 syn match idlInherit contained ":" skipempty skipwhite nextgroup=idlInheritFrom | 82 syn region idlInterfaceContent contained start="{" end="}" skipempty skipwhite nextgroup=idlError,idlSemiColon contains=@idlContentCluster,@idlCommentable |
69 syn match idlInterfaceName contained "[a-zA-Z0-9_]\+" skipempty skipwhite nextgroup=idlInterfaceContent,idlInherit,idlSemiColon | 83 syn match idlInheritFrom2 contained "," skipempty skipwhite nextgroup=idlInheritFrom |
70 syn keyword idlInterface interface skipempty skipwhite nextgroup=idlInterfaceName | 84 syn match idlInheritFrom contained "[a-zA-Z0-9_]\+[ \t]*\(::[ \t]*[a-zA-Z0-9_]\+\)*" skipempty skipwhite nextgroup=idlInheritFrom2,idlInterfaceContent |
71 | 85 syn match idlInherit contained ":" skipempty skipwhite nextgroup=idlInheritFrom |
86 syn match idlInterfaceName contained "[a-zA-Z0-9_]\+" skipempty skipwhite nextgroup=idlInterfaceContent,idlInherit,idlError,idlSemiColon | |
87 syn keyword idlInterface interface dispinterface skipempty skipwhite nextgroup=idlInterfaceName | |
88 syn keyword idlInterfaceSections contained properties methods skipempty skipwhite nextgroup=idlSectionColon,idlError | |
89 syn match idlSectionColon contained ":" | |
90 | |
91 | |
92 syn match idlLibraryName contained "[a-zA-Z0-9_]\+" skipempty skipwhite nextgroup=idlLibraryContent,idlError,idlSemiColon | |
93 syn keyword idlLibrary library skipempty skipwhite nextgroup=idlLibraryName | |
94 syn region idlLibraryContent contained start="{" end="}" skipempty skipwhite nextgroup=idlError,idlSemiColon contains=@idlCommentable,idlAttributes,idlErrorSquareBracket,idlErrorBracket,idlImportlib,idlCoclass,idlTypedef,idlInterface | |
95 | |
96 syn keyword idlImportlib contained importlib skipempty skipwhite nextgroup=idlStringArg | |
97 syn region idlStringArg contained start="(" end=")" contains=idlString nextgroup=idlError,idlSemiColon,idlErrorBrace,idlErrorSquareBracket | |
98 | |
99 syn keyword idlCoclass coclass contained skipempty skipwhite nextgroup=idlCoclassName | |
100 syn match idlCoclassName "[a-zA-Z0-9_]\+" contained skipempty skipwhite nextgroup=idlCoclassDefinition,idlError,idlSemiColon | |
101 | |
102 syn region idlCoclassDefinition contained start="{" end="}" contains=idlCoclassAttributes,idlInterface,idlErrorBracket,idlErrorSquareBracket skipempty skipwhite nextgroup=idlError,idlSemiColon | |
103 syn region idlCoclassAttributes contained start=+\[+ end=+]+ skipempty skipwhite nextgroup=idlInterface contains=idlErrorBracket,idlErrorBrace,idlCoclassAttribute | |
104 syn keyword idlCoclassAttribute contained default source | |
105 "syn keyword idlInterface interface skipempty skipwhite nextgroup=idlInterfaceStubName | |
106 | |
107 syn match idlImportString +"\f\+"+ skipempty skipwhite nextgroup=idlError,idlSemiColon | |
108 syn keyword idlImport import skipempty skipwhite nextgroup=idlImportString | |
109 | |
110 syn region idlAttributes start="\[" end="\]" contains=idlAttribute,idlAttributeParam,idlErrorBracket,idlErrorBrace,idlComment | |
111 syn keyword idlAttribute contained propput propget propputref id helpstring object uuid pointer_default | |
112 if !exists('idl_no_ms_extensions') | |
113 syn keyword idlAttribute contained nonextensible dual version aggregatable restricted hidden noncreatable oleautomation | |
114 endif | |
115 syn region idlAttributeParam contained start="(" end=")" contains=idlString,idlUuid,idlLiteral,idlErrorBrace,idlErrorSquareBracket | |
116 " skipwhite nextgroup=idlArraySize,idlParmList contains=idlArraySize,idlLiteral | |
117 syn match idlErrorBrace contained "}" | |
118 syn match idlErrorBracket contained ")" | |
119 syn match idlErrorSquareBracket contained "\]" | |
120 | |
121 syn match idlUuid contained +[0-9a-zA-Z]\{8}-\([0-9a-zA-Z]\{4}-\)\{3}[0-9a-zA-Z]\{12}+ | |
72 | 122 |
73 " Raises | 123 " Raises |
74 syn keyword idlRaises contained raises skipempty skipwhite nextgroup=idlRaises,idlContext,idlSemiColon | 124 syn keyword idlRaises contained raises skipempty skipwhite nextgroup=idlRaises,idlContext,idlError,idlSemiColon |
75 | 125 |
76 " Context | 126 " Context |
77 syn keyword idlContext contained context skipempty skipwhite nextgroup=idlRaises,idlContext,idlSemiColon | 127 syn keyword idlContext contained context skipempty skipwhite nextgroup=idlRaises,idlContext,idlError,idlSemiColon |
78 | 128 |
79 " Operation | 129 " Operation |
80 syn match idlParmList contained "," skipempty skipwhite nextgroup=idlOpParms | 130 syn match idlParmList contained "," skipempty skipwhite nextgroup=idlOpParms |
81 syn region idlArraySize contained start="\[" end="\]" skipempty skipwhite nextgroup=idlArraySize,idlParmList contains=idlArraySize,idlLiteral | 131 syn region idlArraySize contained start="\[" end="\]" skipempty skipwhite nextgroup=idlArraySize,idlParmList contains=idlArraySize,idlLiteral |
82 syn match idlParmName contained "[a-zA-Z0-9_]\+" skipempty skipwhite nextgroup=idlParmList,idlArraySize | 132 syn match idlParmName contained "[a-zA-Z0-9_]\+" skipempty skipwhite nextgroup=idlParmList,idlArraySize |
83 syn keyword idlParmInt contained short long skipempty skipwhite nextgroup=idlParmName | 133 syn keyword idlParmInt contained short long skipempty skipwhite nextgroup=idlParmName |
84 syn keyword idlParmType contained unsigned skipempty skipwhite nextgroup=idlParmInt | 134 syn keyword idlParmType contained unsigned skipempty skipwhite nextgroup=idlParmInt |
85 syn region idlD3 contained start="<" end=">" skipempty skipwhite nextgroup=idlParmName contains=idlString,idlLiteral | 135 syn region idlD3 contained start="<" end=">" skipempty skipwhite nextgroup=idlParmName contains=idlString,idlLiteral |
86 syn keyword idlParmType contained string skipempty skipwhite nextgroup=idlD3,idlParmName | 136 syn keyword idlParmType contained string skipempty skipwhite nextgroup=idlD3,idlParmName |
87 syn keyword idlParmType contained void float double char boolean octet any skipempty skipwhite nextgroup=idlParmName | 137 syn keyword idlParmType contained void float double char boolean octet any skipempty skipwhite nextgroup=idlParmName |
88 syn match idlParmType contained "[a-zA-Z0-9_]\+[ \t]*\(::[ \t]*[a-zA-Z0-9_]\+\)*" skipempty skipwhite nextgroup=idlParmName | 138 syn match idlParmType contained "[a-zA-Z0-9_]\+[ \t]*\(::[ \t]*[a-zA-Z0-9_]\+\)*" skipempty skipwhite nextgroup=idlParmName |
89 syn keyword idlOpParms contained in out inout skipempty skipwhite nextgroup=idlParmType | 139 syn keyword idlOpParms contained in out inout skipempty skipwhite nextgroup=idlParmType |
90 | 140 |
91 syn region idlOpContents contained start="(" end=")" skipempty skipwhite nextgroup=idlRaises,idlContext,idlSemiColon contains=idlOpParms | 141 if !exists('idl_no_ms_extensions') |
92 syn match idlOpName contained "[a-zA-Z0-9_]\+" skipempty skipwhite nextgroup=idlOpContents | 142 syn keyword idlOpParms contained retval optional skipempty skipwhite nextgroup=idlParmType |
93 syn keyword idlOpInt contained short long skipempty skipwhite nextgroup=idlOpName | 143 syn match idlOpParms contained +\<\(iid_is\|defaultvalue\)\s*([^)]*)+ skipempty skipwhite nextgroup=idlParamType |
94 syn region idlD2 contained start="<" end=">" skipempty skipwhite nextgroup=idlOpName contains=idlString,idlLiteral | 144 |
95 syn keyword idlOp contained unsigned skipempty skipwhite nextgroup=idlOpInt | 145 syn keyword idlVariantType contained BSTR VARIANT VARIANT_BOOL long short unsigned double CURRENCY DATE |
96 syn keyword idlOp contained string skipempty skipwhite nextgroup=idlD2,idlOpName | 146 syn region idlSafeArray contained matchgroup=idlVariantType start=+SAFEARRAY(\s*+ end=+)+ contains=idlVariantType |
97 syn keyword idlOp contained void float double char boolean octet any skipempty skipwhite nextgroup=idlOpName | 147 endif |
98 syn match idlOp contained "[a-zA-Z0-9_]\+[ \t]*\(::[ \t]*[a-zA-Z0-9_]\+\)*" skipempty skipwhite nextgroup=idlOpName | 148 |
99 syn keyword idlOp contained void skipempty skipwhite nextgroup=idlOpName | 149 syn region idlOpContents contained start="(" end=")" skipempty skipwhite nextgroup=idlRaises,idlContext,idlError,idlSemiColon contains=idlOpParms,idlSafeArray,idlVariantType,@idlCommentable |
100 syn keyword idlOneWayOp contained oneway skipempty skipwhite nextgroup=idOp | 150 syn match idlOpName contained "[a-zA-Z0-9_]\+" skipempty skipwhite nextgroup=idlOpContents |
151 syn keyword idlOpInt contained short long skipempty skipwhite nextgroup=idlOpName | |
152 syn region idlD2 contained start="<" end=">" skipempty skipwhite nextgroup=idlOpName contains=idlString,idlLiteral | |
153 syn keyword idlOp contained unsigned skipempty skipwhite nextgroup=idlOpInt | |
154 syn keyword idlOp contained string skipempty skipwhite nextgroup=idlD2,idlOpName | |
155 syn keyword idlOp contained void float double char boolean octet any skipempty skipwhite nextgroup=idlOpName | |
156 syn match idlOp contained "[a-zA-Z0-9_]\+[ \t]*\(::[ \t]*[a-zA-Z0-9_]\+\)*" skipempty skipwhite nextgroup=idlOpName | |
157 syn keyword idlOp contained void skipempty skipwhite nextgroup=idlOpName | |
158 syn keyword idlOneWayOp contained oneway skipempty skipwhite nextgroup=idOp | |
101 | 159 |
102 " Enum | 160 " Enum |
103 syn region idlEnumContents contained start="{" end="}" skipempty skipwhite nextgroup=idlSemiColon, idlSimpDecl contains=idlId,idlComment | 161 syn region idlEnumContents contained start="{" end="}" skipempty skipwhite nextgroup=idlError,idlSemiColon,idlSimpDecl contains=idlId,idlAttributes,@idlCommentable |
104 syn match idlEnumName contained "[a-zA-Z0-9_]\+" skipempty skipwhite nextgroup=idlEnumContents | 162 syn match idlEnumName contained "[a-zA-Z0-9_]\+" skipempty skipwhite nextgroup=idlEnumContents |
105 syn keyword idlEnum enum skipempty skipwhite nextgroup=idlEnumName | 163 syn keyword idlEnum enum skipempty skipwhite nextgroup=idlEnumName,idlEnumContents |
106 | 164 |
107 " Typedef | 165 " Typedef |
108 syn keyword idlTypedef typedef skipempty skipwhite nextgroup=idlBaseType, idlBaseTypeInt, idlSeqType | 166 syn keyword idlTypedef typedef skipempty skipwhite nextgroup=idlTypedefOtherTypeQualifier,idlDefBaseType,idlDefBaseTypeInt,idlDefSeqType,idlDefv1Enum,idlDefEnum,idlDefOtherType,idlDefAttributes,idlError |
167 | |
168 if !exists('idl_no_extensions') | |
169 syn keyword idlTypedefOtherTypeQualifier contained struct enum interface nextgroup=idlDefBaseType,idlDefBaseTypeInt,idlDefSeqType,idlDefv1Enum,idlDefEnum,idlDefOtherType,idlDefAttributes,idlError skipwhite | |
170 | |
171 syn region idlDefAttributes contained start="\[" end="\]" contains=idlAttribute,idlAttributeParam,idlErrorBracket,idlErrorBrace skipempty skipwhite nextgroup=idlDefBaseType,idlDefBaseTypeInt,idlDefSeqType,idlDefv1Enum,idlDefEnum,idlDefOtherType,idlError | |
172 | |
173 syn keyword idlDefBaseType contained float double char boolean octet any skipempty skipwhite nextgroup=idlTypedefDecl,idlError | |
174 syn keyword idlDefBaseTypeInt contained short long skipempty skipwhite nextgroup=idlTypedefDecl,idlError | |
175 syn match idlDefOtherType contained +\<\k\+\>+ skipempty nextgroup=idlTypedefDecl,idlError | |
176 " syn keyword idlDefSeqType contained sequence skipempty skipwhite nextgroup=idlD4 | |
177 | |
178 " Enum typedef | |
179 syn keyword idlDefEnum contained enum skipempty skipwhite nextgroup=idlDefEnumName,idlDefEnumContents | |
180 syn match idlDefEnumName contained "[a-zA-Z0-9_]\+" skipempty skipwhite nextgroup=idlDefEnumContents,idlTypedefDecl | |
181 syn region idlDefEnumContents contained start="{" end="}" skipempty skipwhite nextgroup=idlError,idlTypedefDecl contains=idlId,idlAttributes | |
182 | |
183 syn match idlTypedefDecl contained "[a-zA-Z0-9_]\+" skipempty skipwhite nextgroup=idlError,idlSemiColon | |
184 endif | |
109 | 185 |
110 " Struct | 186 " Struct |
111 syn region idlStructContent contained start="{" end="}" skipempty skipwhite nextgroup=idlSemiColon, idlSimpDecl contains=idlBaseType, idlBaseTypeInt, idlSeqType,idlComment, idlEnum, idlUnion | 187 syn region idlStructContent contained start="{" end="}" skipempty skipwhite nextgroup=idlError,idlSemiColon,idlSimpDecl contains=idlBaseType,idlBaseTypeInt,idlSeqType,@idlCommentable,idlEnum,idlUnion |
112 syn match idlStructName contained "[a-zA-Z0-9_]\+" skipempty skipwhite nextgroup=idlStructContent | 188 syn match idlStructName contained "[a-zA-Z0-9_]\+" skipempty skipwhite nextgroup=idlStructContent |
113 syn keyword idlStruct struct skipempty skipwhite nextgroup=idlStructName | 189 syn keyword idlStruct struct skipempty skipwhite nextgroup=idlStructName |
114 | 190 |
115 " Exception | 191 " Exception |
116 syn keyword idlException exception skipempty skipwhite nextgroup=idlStructName | 192 syn keyword idlException exception skipempty skipwhite nextgroup=idlStructName |
117 | 193 |
118 " Union | 194 " Union |
119 syn match idlColon contained ":" skipempty skipwhite nextgroup=idlCase,idlSeqType,idlBaseType,idlBaseTypeInt | 195 syn match idlColon contained ":" skipempty skipwhite nextgroup=idlCase,idlSeqType,idlBaseType,idlBaseTypeInt |
120 syn region idlCaseLabel contained start="" skip="::" end=":"me=e-1 skipempty skipwhite nextgroup=idlColon contains=idlLiteral,idlString | 196 syn region idlCaseLabel contained start="" skip="::" end=":"me=e-1 skipempty skipwhite nextgroup=idlColon contains=idlLiteral,idlString |
121 syn keyword idlCase contained case skipempty skipwhite nextgroup=idlCaseLabel | 197 syn keyword idlCase contained case skipempty skipwhite nextgroup=idlCaseLabel |
122 syn keyword idlCase contained default skipempty skipwhite nextgroup=idlColon | 198 syn keyword idlCase contained default skipempty skipwhite nextgroup=idlColon |
123 syn region idlUnionContent contained start="{" end="}" skipempty skipwhite nextgroup=idlSemiColon,idlSimpDecl contains=idlCase | 199 syn region idlUnionContent contained start="{" end="}" skipempty skipwhite nextgroup=idlError,idlSemiColon,idlSimpDecl contains=idlCase |
124 syn region idlSwitchType contained start="(" end=")" skipempty skipwhite nextgroup=idlUnionContent | 200 syn region idlSwitchType contained start="(" end=")" skipempty skipwhite nextgroup=idlUnionContent |
125 syn keyword idlUnionSwitch contained switch skipempty skipwhite nextgroup=idlSwitchType | 201 syn keyword idlUnionSwitch contained switch skipempty skipwhite nextgroup=idlSwitchType |
126 syn match idlUnionName contained "[a-zA-Z0-9_]\+" skipempty skipwhite nextgroup=idlUnionSwitch | 202 syn match idlUnionName contained "[a-zA-Z0-9_]\+" skipempty skipwhite nextgroup=idlUnionSwitch |
127 syn keyword idlUnion union skipempty skipwhite nextgroup=idlUnionName | 203 syn keyword idlUnion union skipempty skipwhite nextgroup=idlUnionName |
128 | 204 |
129 syn sync lines=200 | 205 if !exists('idl_no_extensions') |
130 | 206 syn sync match idlInterfaceSync grouphere idlInterfaceContent "\<\(disp\)\=interface\>\s\+\k\+\s*:\s*\k\+\_s*{" skipempty skipwhite nextgroup=idlError,idlSemiColon contains=@idlContentCluster,@idlCommentable |
131 " Define the default highlighting. | 207 syn sync maxlines=1000 minlines=100 |
132 " For version 5.7 and earlier: only when not done already | 208 else |
133 " For version 5.8 and later: only when an item doesn't have highlighting yet | 209 syn sync lines=200 |
134 if version >= 508 || !exists("did_idl_syntax_inits") | 210 endif |
135 if version < 508 | 211 " syn sync fromstart |
136 let did_idl_syntax_inits = 1 | 212 |
137 command -nargs=+ HiLink hi link <args> | 213 if !exists("did_idl_syntax_inits") |
138 else | 214 let did_idl_syntax_inits = 1 |
139 command -nargs=+ HiLink hi def link <args> | 215 " The default methods for highlighting. Can be overridden later |
216 command -nargs=+ HiLink hi def link <args> | |
217 | |
218 HiLink idlInclude Include | |
219 HiLink idlPreProc PreProc | |
220 HiLink idlPreCondit PreCondit | |
221 HiLink idlDefine Macro | |
222 HiLink idlIncluded String | |
223 HiLink idlString String | |
224 HiLink idlComment Comment | |
225 HiLink idlTodo Todo | |
226 HiLink idlLiteral Number | |
227 HiLink idlUuid Number | |
228 HiLink idlType Type | |
229 HiLink idlVariantType idlType | |
230 | |
231 HiLink idlModule Keyword | |
232 HiLink idlInterface Keyword | |
233 HiLink idlEnum Keyword | |
234 HiLink idlStruct Keyword | |
235 HiLink idlUnion Keyword | |
236 HiLink idlTypedef Keyword | |
237 HiLink idlException Keyword | |
238 HiLink idlTypedefOtherTypeQualifier keyword | |
239 | |
240 HiLink idlModuleName Typedef | |
241 HiLink idlInterfaceName Typedef | |
242 HiLink idlEnumName Typedef | |
243 HiLink idlStructName Typedef | |
244 HiLink idlUnionName Typedef | |
245 | |
246 HiLink idlBaseTypeInt idlType | |
247 HiLink idlBaseType idlType | |
248 HiLink idlSeqType idlType | |
249 HiLink idlD1 Paren | |
250 HiLink idlD2 Paren | |
251 HiLink idlD3 Paren | |
252 HiLink idlD4 Paren | |
253 "HiLink idlArraySize Paren | |
254 "HiLink idlArraySize1 Paren | |
255 HiLink idlModuleContent Paren | |
256 HiLink idlUnionContent Paren | |
257 HiLink idlStructContent Paren | |
258 HiLink idlEnumContents Paren | |
259 HiLink idlInterfaceContent Paren | |
260 | |
261 HiLink idlSimpDecl Identifier | |
262 HiLink idlROAttr StorageClass | |
263 HiLink idlAttr Keyword | |
264 HiLink idlConst StorageClass | |
265 | |
266 HiLink idlOneWayOp StorageClass | |
267 HiLink idlOp idlType | |
268 HiLink idlParmType idlType | |
269 HiLink idlOpName Function | |
270 HiLink idlOpParms SpecialComment | |
271 HiLink idlParmName Identifier | |
272 HiLink idlInheritFrom Identifier | |
273 HiLink idlAttribute SpecialComment | |
274 | |
275 HiLink idlId Constant | |
276 "HiLink idlCase Keyword | |
277 HiLink idlCaseLabel Constant | |
278 | |
279 HiLink idlErrorBracket Error | |
280 HiLink idlErrorBrace Error | |
281 HiLink idlErrorSquareBracket Error | |
282 | |
283 HiLink idlImport Keyword | |
284 HiLink idlImportString idlString | |
285 HiLink idlCoclassAttribute StorageClass | |
286 HiLink idlLibrary Keyword | |
287 HiLink idlImportlib Keyword | |
288 HiLink idlCoclass Keyword | |
289 HiLink idlLibraryName Typedef | |
290 HiLink idlCoclassName Typedef | |
291 " hi idlLibraryContent guifg=red | |
292 HiLink idlTypedefDecl Typedef | |
293 HiLink idlDefEnum Keyword | |
294 HiLink idlDefv1Enum Keyword | |
295 HiLink idlDefEnumName Typedef | |
296 HiLink idlDefEnumContents Paren | |
297 HiLink idlDefBaseTypeInt idlType | |
298 HiLink idlDefBaseType idlType | |
299 HiLink idlDefSeqType idlType | |
300 HiLink idlInterfaceSections Label | |
301 | |
302 if exists("idlsyntax_showerror") | |
303 if exists("idlsyntax_showerror_soft") | |
304 hi default idlError guibg=#d0ffd0 | |
305 else | |
306 HiLink idlError Error | |
307 endif | |
140 endif | 308 endif |
141 | |
142 HiLink idlInclude Include | |
143 HiLink idlPreProc PreProc | |
144 HiLink idlPreCondit PreCondit | |
145 HiLink idlDefine Macro | |
146 HiLink idlIncluded String | |
147 HiLink idlString String | |
148 HiLink idlComment Comment | |
149 HiLink idlTodo Todo | |
150 HiLink idlLiteral Number | |
151 | |
152 HiLink idlModule Keyword | |
153 HiLink idlInterface Keyword | |
154 HiLink idlEnum Keyword | |
155 HiLink idlStruct Keyword | |
156 HiLink idlUnion Keyword | |
157 HiLink idlTypedef Keyword | |
158 HiLink idlException Keyword | |
159 | |
160 HiLink idlModuleName Typedef | |
161 HiLink idlInterfaceName Typedef | |
162 HiLink idlEnumName Typedef | |
163 HiLink idlStructName Typedef | |
164 HiLink idlUnionName Typedef | |
165 | |
166 HiLink idlBaseTypeInt idlType | |
167 HiLink idlBaseType idlType | |
168 HiLink idlSeqType idlType | |
169 HiLink idlD1 Paren | |
170 HiLink idlD2 Paren | |
171 HiLink idlD3 Paren | |
172 HiLink idlD4 Paren | |
173 "HiLink idlArraySize Paren | |
174 "HiLink idlArraySize1 Paren | |
175 HiLink idlModuleContent Paren | |
176 HiLink idlUnionContent Paren | |
177 HiLink idlStructContent Paren | |
178 HiLink idlEnumContents Paren | |
179 HiLink idlInterfaceContent Paren | |
180 | |
181 HiLink idlSimpDecl Identifier | |
182 HiLink idlROAttr StorageClass | |
183 HiLink idlAttr Keyword | |
184 HiLink idlConst StorageClass | |
185 | |
186 HiLink idlOneWayOp StorageClass | |
187 HiLink idlOp idlType | |
188 HiLink idlParmType idlType | |
189 HiLink idlOpName Function | |
190 HiLink idlOpParms StorageClass | |
191 HiLink idlParmName Identifier | |
192 HiLink idlInheritFrom Identifier | |
193 | |
194 HiLink idlId Constant | |
195 "HiLink idlCase Keyword | |
196 HiLink idlCaseLabel Constant | |
197 | |
198 delcommand HiLink | 309 delcommand HiLink |
199 endif | 310 endif |
200 | 311 |
201 let b:current_syntax = "idl" | 312 let b:current_syntax = "idl" |
202 | 313 |
203 " vim: ts=8 | 314 " vim: sw=2 et |