@@ -18,30 +18,40 @@ syn keyword rustOperator as
18
18
19
19
syn match rustAssert " \< assert\(\w\) *!" contained
20
20
syn match rustFail " \< fail\(\w\) *!" contained
21
- syn keyword rustKeyword break box continue
22
- syn keyword rustKeyword extern nextgroup =rustExternCrate,rustObsoleteExternMod skipwhite
21
+ syn keyword rustKeyword break
22
+ syn keyword rustKeyword box nextgroup =rustBoxPlacement skipwhite skipempty
23
+ syn keyword rustKeyword continue
24
+ syn keyword rustKeyword extern nextgroup =rustExternCrate,rustObsoleteExternMod skipwhite skipempty
25
+ syn keyword rustKeyword fn nextgroup =rustFuncName skipwhite skipempty
23
26
syn keyword rustKeyword for in if impl let
24
- syn keyword rustKeyword loop once priv pub
25
- syn keyword rustKeyword return
26
- syn keyword rustKeyword unsafe while
27
- syn keyword rustKeyword use nextgroup =rustModPath skipwhite
27
+ syn keyword rustKeyword loop once proc pub
28
+ syn keyword rustKeyword return super
29
+ syn keyword rustKeyword unsafe virtual while
30
+ syn keyword rustKeyword use nextgroup =rustModPath skipwhite skipempty
28
31
" FIXME: Scoped impl's name is also fallen in this category
29
- syn keyword rustKeyword mod trait struct enum type nextgroup =rustIdentifier skipwhite
30
- syn keyword rustKeyword fn nextgroup =rustFuncName skipwhite
31
- syn keyword rustKeyword proc
32
+ syn keyword rustKeyword mod trait struct enum type nextgroup =rustIdentifier skipwhite skipempty
32
33
syn keyword rustStorage mut ref static
33
34
syn keyword rustObsoleteStorage const
34
35
35
36
syn keyword rustInvalidBareKeyword crate
36
37
37
- syn keyword rustExternCrate crate contained nextgroup =rustIdentifier skipwhite
38
- syn keyword rustObsoleteExternMod mod contained nextgroup =rustIdentifier skipwhite
38
+ syn keyword rustExternCrate crate contained nextgroup =rustIdentifier skipwhite skipempty
39
+ syn keyword rustObsoleteExternMod mod contained nextgroup =rustIdentifier skipwhite skipempty
39
40
40
41
syn match rustIdentifier contains =rustIdentifierPrime " \% ([^[:cntrl:][:space:][:punct:][:digit:]]\| _\)\% ([^[:cntrl:][:punct:][:space:]]\| _\) *" display contained
41
42
syn match rustFuncName " \% ([^[:cntrl:][:space:][:punct:][:digit:]]\| _\)\% ([^[:cntrl:][:punct:][:space:]]\| _\) *" display contained
42
43
44
+ syn region rustBoxPlacement matchgroup =rustBoxPlacementParens start =" (" end =" )" contains =TOP contained
45
+ syn keyword rustBoxPlacementExpr GC containedin =rustBoxPlacement
46
+ " Ideally we'd have syntax rules set up to match arbitrary expressions. Since
47
+ " we don't, we'll just define temporary contained rules to handle balancing
48
+ " delimiters.
49
+ syn region rustBoxPlacementBalance start =" (" end =" )" containedin =rustBoxPlacement transparent
50
+ syn region rustBoxPlacementBalance start =" \[ " end =" \] " containedin =rustBoxPlacement transparent
51
+ " {} are handled by rustFoldBraces
52
+
43
53
" Reserved (but not yet used) keywords {{{2
44
- syn keyword rustReservedKeyword alignof be do offsetof pure sizeof typeof yield
54
+ syn keyword rustReservedKeyword alignof be do offsetof priv pure sizeof typeof unsized yield
45
55
46
56
" Built-in types {{{2
47
57
syn keyword rustType int uint float char bool u8 u16 u32 u64 f32
@@ -52,10 +62,10 @@ syn keyword rustType f64 i8 i16 i32 i64 str Self
52
62
" to make it easy to update.
53
63
54
64
" Core operators {{{3
55
- syn keyword rustTrait Share Copy Send Sized
65
+ syn keyword rustTrait Copy Send Sized Share
56
66
syn keyword rustTrait Add Sub Mul Div Rem Neg Not
57
67
syn keyword rustTrait BitAnd BitOr BitXor
58
- syn keyword rustTrait Drop
68
+ syn keyword rustTrait Drop Deref DerefMut
59
69
syn keyword rustTrait Shl Shr Index
60
70
syn keyword rustEnum Option
61
71
syn keyword rustEnumVariant Some None
@@ -68,7 +78,6 @@ syn keyword rustEnumVariant Ok Err
68
78
" syn keyword rustFunction drop
69
79
70
80
" Types and traits {{{3
71
- syn keyword rustTrait Any AnyOwnExt AnyRefExt AnyMutRefExt
72
81
syn keyword rustTrait Ascii AsciiCast OwnedAsciiCast AsciiStr IntoBytes
73
82
syn keyword rustTrait ToCStr
74
83
syn keyword rustTrait Char
@@ -80,25 +89,32 @@ syn keyword rustTrait FromIterator Extendable
80
89
syn keyword rustTrait Iterator DoubleEndedIterator RandomAccessIterator CloneableIterator
81
90
syn keyword rustTrait OrdIterator MutableDoubleEndedIterator ExactSize
82
91
syn keyword rustTrait Num NumCast CheckedAdd CheckedSub CheckedMul
83
- syn keyword rustTrait Signed Unsigned Round
84
- syn keyword rustTrait Primitive Int Float ToPrimitive FromPrimitive
92
+ syn keyword rustTrait Signed Unsigned
93
+ syn keyword rustTrait Primitive Int Float FloatMath ToPrimitive FromPrimitive
94
+ " syn keyword rustTrait Expect
95
+ syn keyword rustTrait Box
85
96
syn keyword rustTrait GenericPath Path PosixPath WindowsPath
86
97
syn keyword rustTrait RawPtr
87
98
syn keyword rustTrait Buffer Writer Reader Seek
88
- syn keyword rustTrait Str StrVector StrSlice OwnedStr IntoMaybeOwned StrBuf
99
+ syn keyword rustTrait Str StrVector StrSlice OwnedStr IntoMaybeOwned
100
+ syn keyword rustTrait StrAllocating
89
101
syn keyword rustTrait ToStr IntoStr
90
102
syn keyword rustTrait Tuple1 Tuple2 Tuple3 Tuple4
91
103
syn keyword rustTrait Tuple5 Tuple6 Tuple7 Tuple8
92
104
syn keyword rustTrait Tuple9 Tuple10 Tuple11 Tuple12
93
- syn keyword rustTrait ImmutableEqVector ImmutableTotalOrdVector ImmutableCloneableVector
94
- syn keyword rustTrait OwnedVector OwnedCloneableVector OwnedEqVector
95
- syn keyword rustTrait MutableVector MutableTotalOrdVector
96
- syn keyword rustTrait Vector VectorVector CloneableVector ImmutableVector
97
-
98
- " syn keyword rustFunction stream
99
- syn keyword rustTrait Sender Receiver
105
+ syn keyword rustTrait CloneableVector ImmutableCloneableVector MutableCloneableVector
106
+ syn keyword rustTrait ImmutableVector MutableVector
107
+ syn keyword rustTrait ImmutableEqVector ImmutableTotalOrdVector MutableTotalOrdVector
108
+ syn keyword rustTrait Vector VectorVector OwnedVector MutableVectorAllocating
109
+ syn keyword rustTrait StrBuf
110
+ syn keyword rustTrait Vec
111
+
112
+ " syn keyword rustFunction sync_channel channel
113
+ syn keyword rustTrait SyncSender Sender Receiver
100
114
" syn keyword rustFunction spawn
101
115
116
+ " syn keyword rustConstant GC
117
+
102
118
syn keyword rustSelf self
103
119
syn keyword rustBoolean true false
104
120
@@ -239,6 +255,8 @@ hi def link rustLifetime Special
239
255
hi def link rustInvalidBareKeyword Error
240
256
hi def link rustExternCrate rustKeyword
241
257
hi def link rustObsoleteExternMod Error
258
+ hi def link rustBoxPlacementParens Delimiter
259
+ hi def link rustBoxPlacementExpr rustKeyword
242
260
243
261
" Other Suggestions:
244
262
" hi rustAttribute ctermfg=cyan
0 commit comments