Skip to content

Commit bb9a237

Browse files
committed
Make existential a contextual keyword
Thanks @dlrobertson who let me use his PR rust-lang#284!
1 parent 8c513bd commit bb9a237

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

syntax/rust.vim

+3-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ 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,7 +31,6 @@ syn keyword rustKeyword break
2931
syn keyword rustKeyword box nextgroup=rustBoxPlacement skipwhite skipempty
3032
syn keyword rustKeyword continue
3133
syn keyword rustKeyword crate
32-
syn keyword rustKeyword existential
3334
syn keyword rustKeyword extern nextgroup=rustExternCrate,rustObsoleteExternMod skipwhite skipempty
3435
syn keyword rustKeyword fn nextgroup=rustFuncName skipwhite skipempty
3536
syn keyword rustKeyword in impl let
@@ -293,6 +294,7 @@ hi def link rustDynKeyword rustKeyword
293294
hi def link rustTypedef Keyword " More precise is Typedef, but it doesn't feel right for Rust
294295
hi def link rustStructure Keyword " More precise is Structure
295296
hi def link rustUnion rustStructure
297+
hi def link rustExistential rustKeyword
296298
hi def link rustPubScopeDelim Delimiter
297299
hi def link rustPubScopeCrate rustKeyword
298300
hi def link rustSuper rustKeyword

0 commit comments

Comments
 (0)