@@ -24,8 +24,9 @@ set cpoptions&vim
24
24
syn keyword csType bool byte char decimal double float int long object sbyte short string T uint ulong ushort var void dynamic
25
25
syn keyword csType nint nuint " contextual
26
26
27
- syn keyword csStorage enum interface namespace struct
28
- syn match csStorage " \< delegate\> "
27
+ syn keyword csStorage namespace
28
+ " syn keyword csStorage enum interface namespace struct
29
+ " syn match csStorage "\<delegate\>"
29
30
syn keyword csRepeat break continue do for foreach goto return while
30
31
syn keyword csConditional else if switch
31
32
syn keyword csLabel case default
@@ -154,13 +155,21 @@ endif
154
155
155
156
syn cluster csPreProcessor contains =csPreProc.*
156
157
157
- syn region csClassType start =" \< class\> " hs =s + 6 end =" [:\n {]" me =e - 1 contains =csClass
158
+ syn region csClassType matchgroup =csStorage start =" \< class\> " end =" [:{]" me =e - 1
159
+ syn region csInterfaceType matchgroup =csStorage start =" \< interface\> " end =" [:{]" me =e - 1
160
+
161
+ syn region csStructType matchgroup =csStorage start =" \< struct\> " end =" [:{]" me =e - 1
162
+ syn region csEnumType matchgroup =csStorage start =" \< enum\> " end =" [:{]" me =e - 1
163
+
164
+ syn match csStorage " \< delegate\>\% (\_ s*[*(]\)\@ !" nextgroup =csDelegateReturnType skipwhite skipempty
165
+ syn match csDelegateReturnType " @\=\h\w *\_ s*\% (<\_ [^>]\+ >\)\= ?\= " nextgroup =csDelegateType skipwhite skipempty contained contains =csType,csGeneric
166
+ syn match csDelegateType " @\=\h\w *\_ s*\% (<\_ [^>]\+ >\)\=\z e\_ s*(" contained
167
+
158
168
" csUserType may be defined by user scripts/plugins - it should be contained in csNewType
159
169
syn region csNewType start =" \< new\> " hs =s + 4 end =" [;\n {(<\[ ]" me =e - 1 contains =csNew,@csNamespaceAlias,csUserType
160
170
syn region csIsType start =" is " hs =s + 4 end =" [A-Za-z0-9]\+ " oneline contains =csIsAs
161
171
syn region csIsType start =" as " hs =s + 4 end =" [A-Za-z0-9]\+ " oneline contains =csIsAs
162
172
syn keyword csNew new contained
163
- syn keyword csClass class contained
164
173
syn keyword csIsAs is as
165
174
166
175
syn keyword csBoolean false true
@@ -223,9 +232,12 @@ syn match csIdentifier "@\h\w*"
223
232
" The default highlighting.
224
233
hi def link csType Type
225
234
hi def link csClassType Type
235
+ hi def link csInterfaceType Type
236
+ hi def link csStructType Type
237
+ hi def link csEnumType Type
238
+ hi def link csDelegateType Type
226
239
hi def link csIsType Type
227
240
hi def link csStorage Structure
228
- hi def link csClass Structure
229
241
hi def link csRepeat Repeat
230
242
hi def link csConditional Conditional
231
243
hi def link csLabel Label
0 commit comments