Skip to content

Commit a118bd7

Browse files
committed
Highlight 1..2 according to the current grammar.
1 parent 81da141 commit a118bd7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/etc/vim/syntax/rust.vim

+3-2
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,10 @@ syn match rustOctNumber display "\<0o[0-7_]\+\%([iu]\%(8\|16\|32\|64\)\=\)
172172
syn match rustBinNumber display "\<0b[01_]\+\%([iu]\%(8\|16\|32\|64\)\=\)\="
173173

174174
" Special case for numbers of the form "1." which are float literals, unless followed by
175-
" an identifier, which makes them integer literals with a method call or field access.
175+
" an identifier, which makes them integer literals with a method call or field access,
176+
" or by another ".", which makes them integer literals followed by the ".." token.
176177
" (This must go first so the others take precedence.)
177-
syn match rustFloat display "\<[0-9][0-9_]*\.\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\@!"
178+
syn match rustFloat display "\<[0-9][0-9_]*\.\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\|\.\)\@!"
178179
" To mark a number as a normal float, it must have at least one of the three things integral values don't have:
179180
" a decimal point and more numbers; an exponent; and a type suffix.
180181
syn match rustFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\%([eE][+-]\=[0-9_]\+\)\=\(f32\|f64\)\="

0 commit comments

Comments
 (0)