Skip to content

Commit 8e30d3f

Browse files
committed
auto merge of #5636 : thestinger/rust/vim, r=luqmana
2 parents 6dd20c8 + 47011e3 commit 8e30d3f

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

src/etc/vim/syntax/rust.vim

+14-12
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,20 @@ elseif exists("b:current_syntax")
1010
finish
1111
endif
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
1617
syn 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
1922
syn keyword rustKeyword unsafe use while
2023
" FIXME: Scoped impl's name is also fallen in this category
2124
syn keyword rustKeyword mod trait struct enum type nextgroup=rustIdentifier skipwhite
2225
syn keyword rustKeyword fn nextgroup=rustFuncName skipwhite
23-
syn keyword rustStorage const mut
26+
syn keyword rustStorage const mut ref static
2427

2528
syn match rustIdentifier contains=rustIdentifierPrime "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
2629
syn match rustFuncName "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
@@ -71,8 +74,8 @@ syn keyword rustConstant STDIN_FILENO STDOUT_FILENO STDERR_FILENO
7174
syn match rustModPath "\w\(\w\)*::[^<]"he=e-3,me=e-3
7275
syn 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

7780
syn match rustMacro '\w\(\w\)*!'
7881
syn match rustMacro '#\w\(\w\)*'
@@ -110,8 +113,7 @@ syn match rustCharacter "'\([^'\\]\|\\\(['nrt\\\"]\|x\x\{2}\|u\x\{4}\|U\x\{8
110113
syn region rustComment start="/\*" end="\*/" contains=rustComment,rustTodo
111114
syn 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

116118
hi def link rustHexNumber rustNumber
117119
hi def link rustBinNumber rustNumber
@@ -126,8 +128,9 @@ hi def link rustBoolean Boolean
126128
hi def link rustConstant Constant
127129
hi def link rustSelf Constant
128130
hi def link rustFloat Float
129-
hi def link rustAssert Keyword
131+
hi def link rustOperator Operator
130132
hi def link rustKeyword Keyword
133+
hi def link rustConditional Conditional
131134
hi def link rustIdentifier Identifier
132135
hi def link rustModPath Include
133136
hi def link rustFuncName Function
@@ -140,7 +143,6 @@ hi def link rustStorage StorageClass
140143
hi def link rustLifetime Special
141144

142145
" Other Suggestions:
143-
" hi rustAssert ctermfg=yellow
144146
" hi rustMacro ctermfg=magenta
145147

146148
syn sync minlines=200

0 commit comments

Comments
 (0)