Skip to content

Commit 9f1cfd3

Browse files
committed
---
yaml --- r: 96633 b: refs/heads/dist-snap c: 1b12dca h: refs/heads/master i: 96631: 69f3586 v: v3
1 parent 861c384 commit 9f1cfd3

File tree

3 files changed

+175
-282
lines changed

3 files changed

+175
-282
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: c274a6888410ce3e357e014568b43310ed787d36
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 5731ca3078318a66a13208133d8839a9f9f92629
9+
refs/heads/dist-snap: 1b12dca7f97a51c6cbb4f47ea6e095d841a97c1a
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/etc/vim/syntax/rust.vim

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
" Maintainer: Patrick Walton <[email protected]>
44
" Maintainer: Ben Blum <[email protected]>
55
" Maintainer: Chris Morgan <[email protected]>
6-
" Last Change: 2013 Dec 04
6+
" Last Change: 2013 Dec 10
77

88
if version < 600
99
syntax clear
@@ -19,23 +19,23 @@ syn keyword rustOperator as
1919
syn match rustAssert "\<assert\(\w\)*!" contained
2020
syn match rustFail "\<fail\(\w\)*!" contained
2121
syn keyword rustKeyword break continue do extern
22-
syn keyword rustKeyword in if impl let log
23-
syn keyword rustKeyword for impl let log
24-
syn keyword rustKeyword loop mod once priv pub
22+
syn keyword rustKeyword for in if impl let
23+
syn keyword rustKeyword loop once priv pub
2524
syn keyword rustKeyword return
2625
syn keyword rustKeyword unsafe while
2726
syn keyword rustKeyword use nextgroup=rustModPath skipwhite
2827
" FIXME: Scoped impl's name is also fallen in this category
2928
syn keyword rustKeyword mod trait struct enum type nextgroup=rustIdentifier skipwhite
3029
syn keyword rustKeyword fn nextgroup=rustFuncName skipwhite
3130
syn keyword rustKeyword proc
32-
syn keyword rustStorage const mut ref static
31+
syn keyword rustStorage mut ref static
32+
syn keyword rustObsoleteStorage const
3333

3434
syn match rustIdentifier contains=rustIdentifierPrime "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
3535
syn match rustFuncName "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
3636

3737
" Reserved (but not yet used) keywords {{{2
38-
syn keyword rustKeyword alignof be offsetof pure sizeof typeof yield
38+
syn keyword rustReservedKeyword alignof be offsetof pure sizeof typeof yield
3939

4040
" Built-in types {{{2
4141
syn keyword rustType int uint float char bool u8 u16 u32 u64 f32
@@ -160,14 +160,15 @@ syn match rustHexNumber display "\<0x[a-fA-F0-9_]\+\%([iu]\%(8\|16\|32\|64
160160
syn match rustOctNumber display "\<0o[0-7_]\+\%([iu]\%(8\|16\|32\|64\)\=\)\="
161161
syn match rustBinNumber display "\<0b[01_]\+\%([iu]\%(8\|16\|32\|64\)\=\)\="
162162

163-
" To mark it as a float, it must have at least one of the three things integral values don't have:
163+
" Special case for numbers of the form "1." which are float literals, unless followed by
164+
" an identifier, which makes them integer literals with a method call or field access.
165+
" (This must go first so the others take precedence.)
166+
syn match rustFloat display "\<[0-9][0-9_]*\.\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\@!"
167+
" To mark a number as a normal float, it must have at least one of the three things integral values don't have:
164168
" a decimal point and more numbers; an exponent; and a type suffix.
165169
syn match rustFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\%([eE][+-]\=[0-9_]\+\)\=\(f32\|f64\)\="
166170
syn match rustFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\=\%([eE][+-]\=[0-9_]\+\)\(f32\|f64\)\="
167171
syn match rustFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\=\%([eE][+-]\=[0-9_]\+\)\=\(f32\|f64\)"
168-
" Special case for numbers of the form "1." which are float literals, unless followed by
169-
" an identifier, which makes them integer literals with a method call or field access.
170-
syn match rustFloat display "\<[0-9][0-9_]*\.\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\@!"
171172

172173
" For the benefit of delimitMate
173174
syn region rustLifetimeCandidate display start=/&'\%(\([^'\\]\|\\\(['nrt0\\\"]\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'\)\@!/ end=/[[:cntrl:][:space:][:punct:]]\@=\|$/ contains=rustSigil,rustLifetime
@@ -227,6 +228,7 @@ hi def link rustSelf Constant
227228
hi def link rustFloat Float
228229
hi def link rustOperator Operator
229230
hi def link rustKeyword Keyword
231+
hi def link rustReservedKeyword Error
230232
hi def link rustConditional Conditional
231233
hi def link rustIdentifier Identifier
232234
hi def link rustCapsIdent rustIdentifier
@@ -247,6 +249,7 @@ hi def link rustTodo Todo
247249
hi def link rustAttribute PreProc
248250
hi def link rustDeriving PreProc
249251
hi def link rustStorage StorageClass
252+
hi def link rustObsoleteStorage Error
250253
hi def link rustLifetime Special
251254

252255
" Other Suggestions:

0 commit comments

Comments
 (0)