@@ -27,14 +27,16 @@ syn keyword rustKeyword for in if impl let
27
27
syn keyword rustKeyword loop once proc pub
28
28
syn keyword rustKeyword return super
29
29
syn keyword rustKeyword unsafe virtual where while
30
- syn keyword rustKeyword use nextgroup =rustModPath,rustModPathInUse skipwhite skipempty
30
+ syn keyword rustKeyword use nextgroup =rustModPath skipwhite skipempty
31
31
" FIXME: Scoped impl's name is also fallen in this category
32
32
syn keyword rustKeyword mod trait struct enum type nextgroup =rustIdentifier skipwhite skipempty
33
33
syn keyword rustStorage mut ref static const
34
34
35
35
syn keyword rustInvalidBareKeyword crate
36
36
37
- syn keyword rustExternCrate crate contained nextgroup =rustIdentifier skipwhite skipempty
37
+ syn keyword rustExternCrate crate contained nextgroup =rustIdentifier,rustExternCrateString skipwhite skipempty
38
+ " This is to get the `bar` part of `extern crate "foo" as bar;` highlighting.
39
+ syn match rustExternCrateString / ".*"\_ s*as/ contained nextgroup =rustIdentifier skipwhite transparent skipempty contains =rustString,rustOperator
38
40
syn keyword rustObsoleteExternMod mod contained nextgroup =rustIdentifier skipwhite skipempty
39
41
40
42
syn match rustIdentifier contains =rustIdentifierPrime " \% ([^[:cntrl:][:space:][:punct:][:digit:]]\| _\)\% ([^[:cntrl:][:punct:][:space:]]\| _\) *" display contained
@@ -131,9 +133,7 @@ syn keyword rustBoolean true false
131
133
" If foo::bar changes to foo.bar, change this ("::" to "\.").
132
134
" If foo::bar changes to Foo::bar, change this (first "\w" to "\u").
133
135
syn match rustModPath " \w\(\w\) *::[^<]" he =e - 3 ,me =e - 3
134
- syn match rustModPathInUse " \w\(\w\) *" contained " only for 'use path;'
135
136
syn match rustModPathSep " ::"
136
- " rustModPathInUse is split out from rustModPath so that :syn-include can get the group list right.
137
137
138
138
syn match rustFuncCall " \w\(\w\) *(" he =e - 1 ,me =e - 1
139
139
syn match rustFuncCall " \w\(\w\) *::<" he =e - 3 ,me =e - 3 " foo::<T>();
@@ -172,9 +172,10 @@ syn match rustOctNumber display "\<0o[0-7_]\+\%([iu]\%(8\|16\|32\|64\)\=\)
172
172
syn match rustBinNumber display " \< 0b[01_]\+\% ([iu]\% (8\| 16\| 32\| 64\)\=\)\= "
173
173
174
174
" Special case for numbers of the form "1." which are float literals, unless followed by
175
- " an identifier, which makes them integer literals with a method call or field access.
175
+ " an identifier, which makes them integer literals with a method call or field access,
176
+ " or by another ".", which makes them integer literals followed by the ".." token.
176
177
" (This must go first so the others take precedence.)
177
- syn match rustFloat display " \< [0-9][0-9_]*\.\% ([^[:cntrl:][:space:][:punct:][:digit:]]\| _\)\@ !"
178
+ syn match rustFloat display " \< [0-9][0-9_]*\.\% ([^[:cntrl:][:space:][:punct:][:digit:]]\| _\|\.\ )\@ !"
178
179
" To mark a number as a normal float, it must have at least one of the three things integral values don't have:
179
180
" a decimal point and more numbers; an exponent; and a type suffix.
180
181
syn match rustFloat display " \< [0-9][0-9_]*\% (\. [0-9][0-9_]*\)\% ([eE][+-]\= [0-9_]\+\)\=\( f32\| f64\)\= "
@@ -252,7 +253,6 @@ hi def link rustReservedKeyword Error
252
253
hi def link rustConditional Conditional
253
254
hi def link rustIdentifier Identifier
254
255
hi def link rustCapsIdent rustIdentifier
255
- hi def link rustModPathInUse rustModPath
256
256
hi def link rustModPath Include
257
257
hi def link rustModPathSep Delimiter
258
258
hi def link rustFunction Function
0 commit comments