Skip to content

Commit d71a68a

Browse files
committed
Merge pull request #20881 from brookst/master
Add new number literal suffixes to Vim syntax highlighting Reviewed-by: alexcrichton
2 parents 3e21520 + 4c78d28 commit d71a68a

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/etc/vim/syntax/rust.vim

+5-7
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ syn match rustMacroVariable "$\w\+"
5959
syn keyword rustReservedKeyword alignof be do offsetof priv pure sizeof typeof unsized yield abstract final override macro
6060

6161
" Built-in types {{{2
62-
syn keyword rustType int isize uint usize float char bool u8 u16 u32 u64 f32
62+
syn keyword rustType isize usize float char bool u8 u16 u32 u64 f32
6363
syn keyword rustType f64 i8 i16 i32 i64 str Self
6464

6565
" Things from the prelude (src/libstd/prelude.rs) {{{2
@@ -95,8 +95,6 @@ syn keyword rustTrait Vec
9595
syn keyword rustTrait Path GenericPath
9696
" FIXME: remove when I/O reform lands
9797
syn keyword rustTrait Buffer Writer Reader Seek BufferPrelude
98-
" FIXME: remove when range syntax lands
99-
syn keyword rustFunction range
10098

10199
" Other syntax {{{2
102100
syn keyword rustSelf self
@@ -139,10 +137,10 @@ syn region rustAttribute start="#!\?\[" end="\]" contains=rustString,rustDe
139137
syn region rustDerive start="derive(" end=")" contained contains=rustTrait
140138

141139
" Number literals
142-
syn match rustDecNumber display "\<[0-9][0-9_]*\%([iu]\%(8\|16\|32\|64\)\=\)\="
143-
syn match rustHexNumber display "\<0x[a-fA-F0-9_]\+\%([iu]\%(8\|16\|32\|64\)\=\)\="
144-
syn match rustOctNumber display "\<0o[0-7_]\+\%([iu]\%(8\|16\|32\|64\)\=\)\="
145-
syn match rustBinNumber display "\<0b[01_]\+\%([iu]\%(8\|16\|32\|64\)\=\)\="
140+
syn match rustDecNumber display "\<[0-9][0-9_]*\%([iu]\%(s\|8\|16\|32\|64\)\)\="
141+
syn match rustHexNumber display "\<0x[a-fA-F0-9_]\+\%([iu]\%(s\|8\|16\|32\|64\)\)\="
142+
syn match rustOctNumber display "\<0o[0-7_]\+\%([iu]\%(s\|8\|16\|32\|64\)\)\="
143+
syn match rustBinNumber display "\<0b[01_]\+\%([iu]\%(s\|8\|16\|32\|64\)\)\="
146144

147145
" Special case for numbers of the form "1." which are float literals, unless followed by
148146
" an identifier, which makes them integer literals with a method call or field access,

0 commit comments

Comments
 (0)