Skip to content

Commit

Permalink
Highlight 1..2 according to the current grammar.
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-morgan committed Oct 14, 2014
1 parent 81da141 commit a118bd7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/etc/vim/syntax/rust.vim
Expand Up @@ -172,9 +172,10 @@ syn match rustOctNumber display "\<0o[0-7_]\+\%([iu]\%(8\|16\|32\|64\)\=\)
syn match rustBinNumber display "\<0b[01_]\+\%([iu]\%(8\|16\|32\|64\)\=\)\="

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

5 comments on commit a118bd7

@bors
Copy link
Contributor

@bors bors commented on a118bd7 Oct 14, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from kballard
at chris-morgan@a118bd7

@bors
Copy link
Contributor

@bors bors commented on a118bd7 Oct 14, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging chris-morgan/rust/vim-misc-2014-10-14 = a118bd7 into auto

@bors
Copy link
Contributor

@bors bors commented on a118bd7 Oct 14, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chris-morgan/rust/vim-misc-2014-10-14 = a118bd7 merged ok, testing candidate = 181538a

@bors
Copy link
Contributor

@bors bors commented on a118bd7 Oct 14, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on a118bd7 Oct 14, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 181538a

Please sign in to comment.