Skip to content

Commit 56a4a23

Browse files
committed
Merge pull request pangloss#214 from davidchambers/regexp
regexp: prevent ")" inside character class from terminating group
2 parents 51a337b + 9b85248 commit 56a4a23

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

syntax/javascript.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ syntax match jsRegexpQuantifier "\v\\@<!%([?*+]|\{\d+%(,|,\d+)?})\??" containe
9292
syntax match jsRegexpOr "\v\<@!\|" contained
9393
syntax match jsRegexpMod "\v\(@<=\?[:=!>]" contained
9494
syntax cluster jsRegexpSpecial contains=jsSpecial,jsRegexpBoundary,jsRegexpBackRef,jsRegexpQuantifier,jsRegexpOr,jsRegexpMod
95-
syntax region jsRegexpGroup start="\\\@<!(" end="\\\@<!)" contained contains=jsRegexpCharClass,@jsRegexpSpecial keepend
95+
syntax region jsRegexpGroup start="\\\@<!(" skip="\\.\|\[\(\\.\|[^]]\)*\]" end="\\\@<!)" contained contains=jsRegexpCharClass,@jsRegexpSpecial keepend
9696
syntax region jsRegexpString start=+\(\(\(return\|case\)\s\+\)\@<=\|\(\([)\]"']\|\d\|\w\)\s*\)\@<!\)/\(\*\|/\)\@!+ skip=+\\.\|\[\(\\.\|[^]]\)*\]+ end=+/[gimy]\{,4}+ contains=jsRegexpCharClass,jsRegexpGroup,@jsRegexpSpecial,@htmlPreproc oneline keepend
9797
syntax match jsNumber /\<-\=\d\+L\=\>\|\<0[xX]\x\+\>/
9898
syntax keyword jsNumber Infinity

0 commit comments

Comments
 (0)