Skip to content

Commit

Permalink
Fix numerical syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
erw7 committed Feb 3, 2018
1 parent 8167c50 commit 43de5bb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions syntax/nim.vim
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,11 @@ syn match nimEscapeError "\\x\x\=\X" display contained

if nim_highlight_numbers == 1
" numbers (including longs and complex)
syn match nimNumber "\v<0x\x+(\'(i|I|f|F|u|U)(8|16|32|64))?>"
syn match nimNumber "\v<[0-9_]+(\'(i|I|f|F|u|U)(8|16|32|64))?>"
syn match nimNumber "\v[0-9]\.[0-9_]+([eE][+-]=[0-9_]+)=>"
syn match nimNumber "\v<[0-9_]+(\.[0-9_]+)?([eE][+-]?[0-9_]+)?(\'(f|F)(32|64))?>"
syn match nimNumber "\v<0[bB][01]%(_?[01])*%(\'%(%(i|I|u|U)%(8|16|32|64)|u|U|%(f|F)%(32|64|128)?|d|D))?>"
syn match nimNumber "\v<0[ocC]\o%(_?\o)*%(\'%(%(i|I|u|U)%(8|16|32|64)|u|U|%(f|F)%(32|64|128)?|d|D))?>"
syn match nimNumber "\v<0[xX]\x%(_?\x)*%(\'%(%(i|I|u|U)%(8|16|32|64)|u|U|%(f|F)%(32|64|128)?|d|D))?>"
syn match nimNumber "\v<\d%(_?\d)*%(%(\'%(%(i|I|u|U)%(8|16|32|64)|u|U)|%([eE][+-]?\d%(_?\d)*)?\'%(%(%(f|F)%(32|64|128)?|d|D))))?>"
syn match nimNumber "\v<\d%(_?\d)*\.\d%(_?\d)*%([eE][+-]?\d%(_?\d)*)?%(\'%(%(f|F)%(32|64|128)?|d|D))?>"
endif

if nim_highlight_builtins == 1
Expand Down

0 comments on commit 43de5bb

Please sign in to comment.