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

Add numeric separators #1236

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
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
11 changes: 8 additions & 3 deletions syntax/javascript.vim
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,14 @@ syntax match jsModuleComma contained /,/ skipwhite skipempty nextgroup=
syntax region jsString start=+\z(["']\)+ skip=+\\\%(\z1\|$\)+ end=+\z1+ end=+$+ contains=jsSpecial extend
syntax region jsTemplateString start=+`+ skip=+\\`+ end=+`+ contains=jsTemplateExpression,jsSpecial extend
syntax match jsTaggedTemplate /\<\K\k*\ze`/ nextgroup=jsTemplateString
syntax match jsNumber /\c\<\%(\d\+\%(e[+-]\=\d\+\)\=\|0b[01]\+\|0o\o\+\|0x\%(\x\|_\)\+\)\>/
syntax keyword jsNumber Infinity
syntax match jsFloat /\c\<\%(\d\+\.\d\+\|\d\+\.\|\.\d\+\)\%(e[+-]\=\d\+\)\=\>/

syntax keyword jsNumber Infinity
syntax match jsNumber /\c\<\%(\%(\d\|\d_\d\)\+\%(e[+-]\=\%(\d\|\d_\d\)\+\)\=\)n\=\>/
syntax match jsNumber /\c\<\%(0b\%([01]\|[01]_[01]\)\+\)\n\=\>/
syntax match jsNumber /\c\<\%(0o\%(\o\|\o_\o\)\+\)n\=\>/
syntax match jsNumber /\c\<\%(0x\%(\x\|\x_\x\)\+\)n\=\>/

syntax match jsFloat /\c\<\%(\%(\%(\d\|\d_\d\)\+\)\=\.\%(\%(\d\|\d_\d\)\+\)\=\)\%(e[+-]\=\%(\d\|\d_\d\)\+\)\=\>/

" Regular Expressions
syntax match jsSpecial contained "\v\\%(x\x\x|u%(\x{4}|\{\x{4,5}})|c\u|.)"
Expand Down