summaryrefslogtreecommitdiffstats
path: root/syntax/rust.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2014-03-11 00:36:09 +0100
committerAdam Stankiewicz <sheerun@sher.pl>2014-03-11 00:36:09 +0100
commit94f72a68c3dccade13ec7203a284620040f930f1 (patch)
treea19a08381285c40c59f882b211039514ea2e69d4 /syntax/rust.vim
parent9b3b092d15503ed70ea4bf60c4e1345b196c3677 (diff)
downloadvim-polyglot-94f72a68c3dccade13ec7203a284620040f930f1.tar.gz
vim-polyglot-94f72a68c3dccade13ec7203a284620040f930f1.zip
Updatev1.5.3
Diffstat (limited to 'syntax/rust.vim')
-rw-r--r--syntax/rust.vim50
1 files changed, 21 insertions, 29 deletions
diff --git a/syntax/rust.vim b/syntax/rust.vim
index 837a8787..bd27f057 100644
--- a/syntax/rust.vim
+++ b/syntax/rust.vim
@@ -3,7 +3,7 @@
" Maintainer: Patrick Walton <pcwalton@mozilla.com>
" Maintainer: Ben Blum <bblum@cs.cmu.edu>
" Maintainer: Chris Morgan <me@chrismorgan.info>
-" Last Change: 2014 Feb 14
+" Last Change: 2014 Feb 27
if version < 600
syntax clear
@@ -18,8 +18,8 @@ syn keyword rustOperator as
syn match rustAssert "\<assert\(\w\)*!" contained
syn match rustFail "\<fail\(\w\)*!" contained
-syn keyword rustKeyword break continue do
-syn keyword rustKeyword extern nextgroup=rustExternCrate skipwhite
+syn keyword rustKeyword break continue
+syn keyword rustKeyword extern nextgroup=rustExternCrate,rustObsoleteExternMod skipwhite
syn keyword rustKeyword for in if impl let
syn keyword rustKeyword loop once priv pub
syn keyword rustKeyword return
@@ -35,12 +35,13 @@ syn keyword rustObsoleteStorage const
syn keyword rustInvalidBareKeyword crate
syn keyword rustExternCrate crate contained nextgroup=rustIdentifier skipwhite
+syn keyword rustObsoleteExternMod mod contained nextgroup=rustIdentifier skipwhite
syn match rustIdentifier contains=rustIdentifierPrime "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
syn match rustFuncName "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
" Reserved (but not yet used) keywords {{{2
-syn keyword rustReservedKeyword alignof be offsetof pure sizeof typeof yield
+syn keyword rustReservedKeyword alignof be do offsetof pure sizeof typeof yield
" Built-in types {{{2
syn keyword rustType int uint float char bool u8 u16 u32 u64 f32
@@ -51,8 +52,7 @@ syn keyword rustType f64 i8 i16 i32 i64 str Self
" to make it easy to update.
" Core operators {{{3
-syn keyword rustTrait Sized
-syn keyword rustTrait Freeze Send
+syn keyword rustTrait Freeze Pod Send Sized
syn keyword rustTrait Add Sub Mul Div Rem Neg Not
syn keyword rustTrait BitAnd BitOr BitXor
syn keyword rustTrait Drop
@@ -63,32 +63,25 @@ syn keyword rustEnum Result
syn keyword rustEnumVariant Ok Err
" Functions {{{3
-"syn keyword rustFunction print println
-"syn keyword rustFunction range
"syn keyword rustFunction from_str
+"syn keyword rustFunction range
+"syn keyword rustFunction drop
" Types and traits {{{3
syn keyword rustTrait Any AnyOwnExt AnyRefExt AnyMutRefExt
syn keyword rustTrait Ascii AsciiCast OwnedAsciiCast AsciiStr IntoBytes
-syn keyword rustTrait Bool
syn keyword rustTrait ToCStr
syn keyword rustTrait Char
syn keyword rustTrait Clone DeepClone
syn keyword rustTrait Eq Ord TotalEq TotalOrd Ordering Equiv
syn keyword rustEnumVariant Less Equal Greater
syn keyword rustTrait Container Mutable Map MutableMap Set MutableSet
-syn keyword rustTrait Default
-syn keyword rustTrait Hash
-syn keyword rustTrait FromStr
syn keyword rustTrait FromIterator Extendable
syn keyword rustTrait Iterator DoubleEndedIterator RandomAccessIterator CloneableIterator
syn keyword rustTrait OrdIterator MutableDoubleEndedIterator ExactSize
-
-syn keyword rustTrait Algebraic Trigonometric Exponential Hyperbolic
-syn keyword rustTrait Bitwise Bounded Fractional
-syn keyword rustTrait Num NumCast CheckedAdd CheckedSub CheckedMul CheckedDiv
-syn keyword rustTrait Orderable Signed Unsigned Round
-syn keyword rustTrait Primitive Int Float ToStrRadix ToPrimitive FromPrimitive
+syn keyword rustTrait Num NumCast CheckedAdd CheckedSub CheckedMul
+syn keyword rustTrait Signed Unsigned Round
+syn keyword rustTrait Primitive Int Float ToPrimitive FromPrimitive
syn keyword rustTrait GenericPath Path PosixPath WindowsPath
syn keyword rustTrait RawPtr
syn keyword rustTrait Buffer Writer Reader Seek
@@ -98,20 +91,17 @@ syn keyword rustTrait Tuple1 Tuple2 Tuple3 Tuple4
syn keyword rustTrait Tuple5 Tuple6 Tuple7 Tuple8
syn keyword rustTrait Tuple9 Tuple10 Tuple11 Tuple12
syn keyword rustTrait ImmutableEqVector ImmutableTotalOrdVector ImmutableCloneableVector
-syn keyword rustTrait OwnedVector OwnedCloneableVector OwnedEqVector MutableVector
+syn keyword rustTrait OwnedVector OwnedCloneableVector OwnedEqVector
+syn keyword rustTrait MutableVector MutableTotalOrdVector
syn keyword rustTrait Vector VectorVector CloneableVector ImmutableVector
"syn keyword rustFunction stream
-syn keyword rustTrait Port Chan GenericChan GenericSmartChan GenericPort Peekable
+syn keyword rustTrait Port Chan
"syn keyword rustFunction spawn
syn keyword rustSelf self
syn keyword rustBoolean true false
-syn keyword rustConstant Some None " option
-syn keyword rustConstant Ok Err " result
-syn keyword rustConstant Less Equal Greater " Ordering
-
" Other syntax {{{2
" If foo::bar changes to foo.bar, change this ("::" to "\.").
@@ -173,11 +163,12 @@ syn region rustGenericLifetimeCandidate display start=/\%(<\|,\s*\)\@<='/ end=/[
syn match rustLifetime display "\'\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*"
syn match rustCharacter /'\([^'\\]\|\\\(.\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'/ contains=rustSpecial,rustSpecialError
-syn cluster rustComment contains=rustCommentLine,rustCommentLineDoc,rustCommentBlock,rustCommentBlockDoc
-syn region rustCommentLine start="//" end="$" contains=rustTodo,@Spell
-syn region rustCommentLineDoc start="//\%(//\@!\|!\)" end="$" contains=rustTodo,@Spell
-syn region rustCommentBlock matchgroup=rustCommentBlock start="/\*\%(!\|\*[*/]\@!\)\@!" end="\*/" contains=rustTodo,@rustComment,@Spell keepend extend
-syn region rustCommentBlockDoc matchgroup=rustCommentBlockDoc start="/\*\%(!\|\*[*/]\@!\)" end="\*/" contains=rustTodo,@rustComment,@Spell keepend extend
+syn region rustCommentLine start="//" end="$" contains=rustTodo,@Spell
+syn region rustCommentLineDoc start="//\%(//\@!\|!\)" end="$" contains=rustTodo,@Spell
+syn region rustCommentBlock matchgroup=rustCommentBlock start="/\*\%(!\|\*[*/]\@!\)\@!" end="\*/" contains=rustTodo,rustCommentBlockNest,@Spell
+syn region rustCommentBlockDoc matchgroup=rustCommentBlockDoc start="/\*\%(!\|\*[*/]\@!\)" end="\*/" contains=rustTodo,rustCommentBlockDocNest,@Spell
+syn region rustCommentBlockNest matchgroup=rustCommentBlock start="/\*" end="\*/" contains=rustTodo,rustCommentBlockNest,@Spell contained transparent
+syn region rustCommentBlockDocNest matchgroup=rustCommentBlockDoc start="/\*" end="\*/" contains=rustTodo,rustCommentBlockDocNest,@Spell contained transparent
" FIXME: this is a really ugly and not fully correct implementation. Most
" importantly, a case like ``/* */*`` should have the final ``*`` not being in
" a comment, but in practice at present it leaves comments open two levels
@@ -247,6 +238,7 @@ hi def link rustObsoleteStorage Error
hi def link rustLifetime Special
hi def link rustInvalidBareKeyword Error
hi def link rustExternCrate rustKeyword
+hi def link rustObsoleteExternMod Error
" Other Suggestions:
" hi rustAttribute ctermfg=cyan