Skip to content

Commit fabad27

Browse files
hcplda-x
authored andcommitted
Add new keywords (#282)
* Add new keywords * `async` from rust-lang/rfcs#2394; * `existential` from rust-lang/rfcs#2071. * Make `existential` a contextual keyword Thanks @dlrobertson who let me use his PR #284!
1 parent 3f3c898 commit fabad27

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

syntax/rust.vim

+4
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,12 @@ syn keyword rustStructure struct enum nextgroup=rustIdentifier skipwhite skipe
2121
syn keyword rustUnion union nextgroup=rustIdentifier skipwhite skipempty contained
2222
syn match rustUnionContextual /\<union\_s\+\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*/ transparent contains=rustUnion
2323
syn keyword rustOperator as
24+
syn keyword rustExistential existential nextgroup=rustTypedef skipwhite skipempty contained
25+
syn match rustExistentialContextual /\<existential\_s\+type/ transparent contains=rustExistential,rustTypedef
2426

2527
syn match rustAssert "\<assert\(\w\)*!" contained
2628
syn match rustPanic "\<panic\(\w\)*!" contained
29+
syn keyword rustKeyword async
2730
syn keyword rustKeyword break
2831
syn keyword rustKeyword box nextgroup=rustBoxPlacement skipwhite skipempty
2932
syn keyword rustKeyword continue
@@ -291,6 +294,7 @@ hi def link rustDynKeyword rustKeyword
291294
hi def link rustTypedef Keyword " More precise is Typedef, but it doesn't feel right for Rust
292295
hi def link rustStructure Keyword " More precise is Structure
293296
hi def link rustUnion rustStructure
297+
hi def link rustExistential rustKeyword
294298
hi def link rustPubScopeDelim Delimiter
295299
hi def link rustPubScopeCrate rustKeyword
296300
hi def link rustSuper rustKeyword

0 commit comments

Comments
 (0)