Skip to content

Commit

Permalink
Add new keywords (#282)
Browse files Browse the repository at this point in the history
* 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!
  • Loading branch information
hcpl authored and da-x committed Nov 29, 2018
1 parent 3f3c898 commit fabad27
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions syntax/rust.vim
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@ syn keyword rustStructure struct enum nextgroup=rustIdentifier skipwhite skipe
syn keyword rustUnion union nextgroup=rustIdentifier skipwhite skipempty contained
syn match rustUnionContextual /\<union\_s\+\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*/ transparent contains=rustUnion
syn keyword rustOperator as
syn keyword rustExistential existential nextgroup=rustTypedef skipwhite skipempty contained
syn match rustExistentialContextual /\<existential\_s\+type/ transparent contains=rustExistential,rustTypedef

syn match rustAssert "\<assert\(\w\)*!" contained
syn match rustPanic "\<panic\(\w\)*!" contained
syn keyword rustKeyword async
syn keyword rustKeyword break
syn keyword rustKeyword box nextgroup=rustBoxPlacement skipwhite skipempty
syn keyword rustKeyword continue
Expand Down Expand Up @@ -291,6 +294,7 @@ hi def link rustDynKeyword rustKeyword
hi def link rustTypedef Keyword " More precise is Typedef, but it doesn't feel right for Rust
hi def link rustStructure Keyword " More precise is Structure
hi def link rustUnion rustStructure
hi def link rustExistential rustKeyword
hi def link rustPubScopeDelim Delimiter
hi def link rustPubScopeCrate rustKeyword
hi def link rustSuper rustKeyword
Expand Down

0 comments on commit fabad27

Please sign in to comment.