Fix numerical syntax

This commit is contained in:
erw7 2018-02-02 16:25:54 +09:00
commit 43de5bb9a1

View file

@ -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