3
3
" Maintainer: Patrick Walton <[email protected] >
4
4
" Maintainer: Ben Blum <[email protected] >
5
5
" Maintainer: Chris Morgan <[email protected] >
6
- " Last Change: July 06 , 2014
6
+ " Last Change: July 18 , 2014
7
7
8
8
if version < 600
9
9
syntax clear
@@ -38,7 +38,7 @@ syn keyword rustKeyword for in if impl let
38
38
syn keyword rustKeyword loop once proc pub
39
39
syn keyword rustKeyword return super
40
40
syn keyword rustKeyword unsafe virtual while
41
- syn keyword rustKeyword use nextgroup =rustModPath skipwhite skipempty
41
+ syn keyword rustKeyword use nextgroup =rustModPath,rustModPathInUse skipwhite skipempty
42
42
" FIXME: Scoped impl's name is also fallen in this category
43
43
syn keyword rustKeyword mod trait struct enum type nextgroup =rustIdentifier skipwhite skipempty
44
44
syn keyword rustStorage mut ref static const
@@ -60,6 +60,10 @@ syn region rustBoxPlacementBalance start="(" end=")" containedin=rustBoxPlace
60
60
syn region rustBoxPlacementBalance start =" \[ " end =" \] " containedin =rustBoxPlacement transparent
61
61
" {} are handled by rustFoldBraces
62
62
63
+ syn region rustMacroRepeat matchgroup =rustMacroRepeatDelimiters start =" $(" end =" )" contains =TOP nextgroup =rustMacroRepeatCount
64
+ syn match rustMacroRepeatCount " .\? [*+]" contained
65
+ syn match rustMacroVariable " $\w\+ "
66
+
63
67
" Reserved (but not yet used) keywords {{{2
64
68
syn keyword rustReservedKeyword alignof be do offsetof priv pure sizeof typeof unsized yield
65
69
@@ -138,8 +142,9 @@ syn keyword rustBoolean true false
138
142
" If foo::bar changes to foo.bar, change this ("::" to "\.").
139
143
" If foo::bar changes to Foo::bar, change this (first "\w" to "\u").
140
144
syn match rustModPath " \w\(\w\) *::[^<]" he =e - 3 ,me =e - 3
141
- syn match rustModPath " \w\(\w\) *" contained " only for 'use path;'
145
+ syn match rustModPathInUse " \w\(\w\) *" contained " only for 'use path;'
142
146
syn match rustModPathSep " ::"
147
+ " rustModPathInUse is split out from rustModPath so that :syn-include can get the group list right.
143
148
144
149
syn match rustFuncCall " \w\(\w\) *(" he =e - 1 ,me =e - 1
145
150
syn match rustFuncCall " \w\(\w\) *::<" he =e - 3 ,me =e - 3 " foo::<T>();
@@ -233,6 +238,9 @@ hi def link rustBinNumber rustNumber
233
238
hi def link rustIdentifierPrime rustIdentifier
234
239
hi def link rustTrait rustType
235
240
241
+ hi def link rustMacroRepeatCount rustMacroRepeatDelimiters
242
+ hi def link rustMacroRepeatDelimiters Macro
243
+ hi def link rustMacroVariable Define
236
244
hi def link rustSigil StorageClass
237
245
hi def link rustEscape Special
238
246
hi def link rustEscapeUnicode rustEscape
@@ -255,6 +263,7 @@ hi def link rustReservedKeyword Error
255
263
hi def link rustConditional Conditional
256
264
hi def link rustIdentifier Identifier
257
265
hi def link rustCapsIdent rustIdentifier
266
+ hi def link rustModPathInUse rustModPath
258
267
hi def link rustModPath Include
259
268
hi def link rustModPathSep Delimiter
260
269
hi def link rustFunction Function
0 commit comments