@@ -15,11 +15,17 @@ if !exists("main_syntax")
15
15
endif
16
16
17
17
syn keyword rustKeyword alt as assert be bind break
18
- syn keyword rustKeyword check claim cont const copy do else enum export fail
19
- syn keyword rustKeyword fn for if iface impl import in inline lambda let log
18
+ syn keyword rustKeyword check claim cont const copy do else export fail
19
+ syn keyword rustKeyword for if impl import in inline lambda let log
20
20
syn keyword rustKeyword loop mod mut mutable native note of prove pure
21
- syn keyword rustKeyword resource ret self syntax to type unchecked
21
+ syn keyword rustKeyword ret self syntax to unchecked
22
22
syn keyword rustKeyword unsafe use while with
23
+ " FIXME: Scoped impl's name is also fallen in this category
24
+ syn keyword rustKeyword mod iface resource class enum type nextgroup =rustIdentifier skipwhite
25
+ syn keyword rustKeyword fn nextgroup =rustFuncName skipwhite
26
+
27
+ syn match rustIdentifier " \% ([^[:cntrl:][:space:][:punct:][:digit:]]\| _\)\% ([^[:cntrl:][:punct:][:space:]]\| _\) *" display contained
28
+ syn match rustFuncName " \% ([^[:cntrl:][:space:][:punct:][:digit:]]\| _\)\% ([^[:cntrl:][:punct:][:space:]]\| _\) *" display contained
23
29
24
30
" Reserved words
25
31
syn keyword rustKeyword m32 m64 m128 f80 f16 f128 class trait
@@ -59,6 +65,8 @@ hi def link rustNumber Number
59
65
hi def link rustBoolean Boolean
60
66
hi def link rustFloat Float
61
67
hi def link rustKeyword Keyword
68
+ hi def link rustIdentifier Identifier
69
+ hi def link rustFuncName Function
62
70
hi def link rustComment Comment
63
71
hi def link rustMacro Macro
64
72
hi def link rustType Type
0 commit comments