@@ -10,17 +10,20 @@ elseif exists("b:current_syntax")
1010 finish
1111endif
1212
13- syn match rustAssert " \< assert\(\w\) *"
14- syn keyword rustKeyword as break
15- syn keyword rustKeyword copy do drop else extern
13+ syn keyword rustConditional match if else
14+ syn keyword rustOperator as
15+
16+ syn keyword rustKeyword break copy do drop extern
1617syn keyword rustKeyword for if impl let log
17- syn keyword rustKeyword loop match mod once priv pub pure
18- syn keyword rustKeyword ref return static
18+ syn keyword rustKeyword copy do drop extern
19+ syn keyword rustKeyword for impl let log
20+ syn keyword rustKeyword loop mod once priv pub
21+ syn keyword rustKeyword return
1922syn keyword rustKeyword unsafe use while
2023" FIXME: Scoped impl's name is also fallen in this category
2124syn keyword rustKeyword mod trait struct enum type nextgroup =rustIdentifier skipwhite
2225syn keyword rustKeyword fn nextgroup =rustFuncName skipwhite
23- syn keyword rustStorage const mut
26+ syn keyword rustStorage const mut ref static
2427
2528syn match rustIdentifier contains =rustIdentifierPrime " \% ([^[:cntrl:][:space:][:punct:][:digit:]]\| _\)\% ([^[:cntrl:][:punct:][:space:]]\| _\) *" display contained
2629syn match rustFuncName " \% ([^[:cntrl:][:space:][:punct:][:digit:]]\| _\)\% ([^[:cntrl:][:punct:][:space:]]\| _\) *" display contained
@@ -71,8 +74,8 @@ syn keyword rustConstant STDIN_FILENO STDOUT_FILENO STDERR_FILENO
7174syn match rustModPath " \w\(\w\) *::[^<]" he =e - 3 ,me =e - 3
7275syn match rustModPathSep " ::"
7376
74- syn match rustFuncCall " \w\(\w\) *(" he =e - 1 ,me =e - 1 contains = rustAssert
75- syn match rustFuncCall " \w\(\w\) *::<" he =e - 3 ,me =e - 3 contains = rustAssert " foo::<T>();
77+ syn match rustFuncCall " \w\(\w\) *(" he =e - 1 ,me =e - 1
78+ syn match rustFuncCall " \w\(\w\) *::<" he =e - 3 ,me =e - 3 " foo::<T>();
7679
7780syn match rustMacro ' \w\(\w\) *!'
7881syn match rustMacro ' #\w\(\w\) *'
@@ -110,8 +113,7 @@ syn match rustCharacter "'\([^'\\]\|\\\(['nrt\\\"]\|x\x\{2}\|u\x\{4}\|U\x\{8
110113syn region rustComment start =" /\* " end =" \* /" contains =rustComment,rustTodo
111114syn region rustComment start =" //" skip =" \\ $" end =" $" contains =rustTodo keepend
112115
113-
114- syn keyword rustTodo TODO FIXME XXX NB unsafe
116+ syn keyword rustTodo contained TODO FIXME XXX NB
115117
116118hi def link rustHexNumber rustNumber
117119hi def link rustBinNumber rustNumber
@@ -126,8 +128,9 @@ hi def link rustBoolean Boolean
126128hi def link rustConstant Constant
127129hi def link rustSelf Constant
128130hi def link rustFloat Float
129- hi def link rustAssert Keyword
131+ hi def link rustOperator Operator
130132hi def link rustKeyword Keyword
133+ hi def link rustConditional Conditional
131134hi def link rustIdentifier Identifier
132135hi def link rustModPath Include
133136hi def link rustFuncName Function
@@ -140,7 +143,6 @@ hi def link rustStorage StorageClass
140143hi def link rustLifetime Special
141144
142145" Other Suggestions:
143- " hi rustAssert ctermfg=yellow
144146" hi rustMacro ctermfg=magenta
145147
146148syn sync minlines =200
0 commit comments