Skip to content

Commit 84c6018

Browse files
committed
Update vim syntax for extern crate
1 parent 92c5738 commit 84c6018

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/etc/vim/syntax/rust.vim

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
" Maintainer: Patrick Walton <pcwalton@mozilla.com>
44
" Maintainer: Ben Blum <bblum@cs.cmu.edu>
55
" Maintainer: Chris Morgan <me@chrismorgan.info>
6-
" Last Change: 2014 Jan 4
6+
" Last Change: 2014 Feb 14
77

88
if version < 600
99
syntax clear
@@ -18,7 +18,8 @@ syn keyword rustOperator as
1818

1919
syn match rustAssert "\<assert\(\w\)*!" contained
2020
syn match rustFail "\<fail\(\w\)*!" contained
21-
syn keyword rustKeyword break continue do extern
21+
syn keyword rustKeyword break continue do
22+
syn keyword rustKeyword extern nextgroup=rustExternCrate skipwhite
2223
syn keyword rustKeyword for in if impl let
2324
syn keyword rustKeyword loop once priv pub
2425
syn keyword rustKeyword return
@@ -31,6 +32,10 @@ syn keyword rustKeyword proc
3132
syn keyword rustStorage mut ref static
3233
syn keyword rustObsoleteStorage const
3334

35+
syn keyword rustInvalidBareKeyword crate
36+
37+
syn keyword rustExternCrate crate contained nextgroup=rustIdentifier skipwhite
38+
3439
syn match rustIdentifier contains=rustIdentifierPrime "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
3540
syn match rustFuncName "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
3641

@@ -245,6 +250,8 @@ hi def link rustDeriving PreProc
245250
hi def link rustStorage StorageClass
246251
hi def link rustObsoleteStorage Error
247252
hi def link rustLifetime Special
253+
hi def link rustInvalidBareKeyword Error
254+
hi def link rustExternCrate rustKeyword
248255

249256
" Other Suggestions:
250257
" hi rustAttribute ctermfg=cyan

0 commit comments

Comments
 (0)