Merge pull request #15 from iarna/js-regex-charclasses

Improve javascript regex character class handling
This commit is contained in:
Christian Nicolai 2014-10-08 11:31:34 +02:00
commit 0406fcbb47
1 changed files with 31 additions and 1 deletions

32
js.jsf
View File

@ -172,7 +172,7 @@ done
"a-zA-Z0-9_." bad_after_term "a-zA-Z0-9_." bad_after_term
:re_or_comment Syntax :re_or_comment Syntax
* regex recolor=-2 * regex noeat recolor=-2
"*/" maybe_comment noeat "*/" maybe_comment noeat
:maybe_comment Syntax :maybe_comment Syntax
@ -201,10 +201,40 @@ done
:regex Regexp :regex Regexp
* regex * regex
"\\" regex_quote recolor=-1 "\\" regex_quote recolor=-1
"[" regex_charclass
"/" regex_mod "/" regex_mod
"\n" regex_bad
:regex_quote RegexpEscape :regex_quote RegexpEscape
* regex * regex
"\n" regex_bad
:regex_charclass Regexp
* regex_charclass
"\\" regex_cc_quote recolor=-1
"\n" regex_bad_cc
"]" regex
:regex_cc_quote RegexpEscape
* regex_charclass
"\n" regex_bad_cc
:regex_bad Bad
* regex_bad
"\\" regex_bad_quote
"[" regex_bad_cc
"/" after_term
:regex_bad_quote Bad
* regex_bad
:regex_bad_cc Bad
* regex_bad_cc
"\\" regex_bad_quote_cc
"]" regex_bad
:regex_bad_quote_cc Bad
* regex_bad_cc
:regex_mod RegexpOptions :regex_mod RegexpOptions
* after_term noeat * after_term noeat