Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

syntax: improve highlighting of erroneous numerics #2571

Merged
merged 1 commit into from
Nov 10, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions syntax/go.vim
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,15 @@ syn match goSingleDecl /\%(import\|var\|const\) [^(]\@=/ contains=g
" Integers
syn match goDecimalInt "\<-\=\d\+\%([Ee][-+]\=\d\+\)\=\>"
syn match goHexadecimalInt "\<-\=0[xX]\x\+\>"
syn match goHexadecimalError "\<-\=0[xX]\x*[^ \t0-9A-Fa-f]\S*\>"
syn match goOctalInt "\<-\=0\o\+\>"
syn match goOctalError "\<-\=0\o*[89]\d*\>"
syn match goOctalError "\<-\=0[^XxBb]\o*[^ \t0-7]\S*\>"
syn match goBinaryInt "\<-\=0[bB][01]\+\>"
syn match goBinaryError "\<-\=0[bB][01]*[2-9]\+[01]*\>"
syn match goBinaryError "\<-\=0[bB][01]*[^ \t01]\S*\>"

hi def link goDecimalInt Integer
hi def link goHexadecimalInt Integer
hi def link goHexadecimalError Error
hi def link goOctalInt Integer
hi def link goOctalError Error
hi def link goBinaryInt Integer
Expand Down