aboutsummaryrefslogtreecommitdiffhomepage
path: root/lexers/LexHTML.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'lexers/LexHTML.cxx')
-rw-r--r--lexers/LexHTML.cxx8
1 files changed, 3 insertions, 5 deletions
diff --git a/lexers/LexHTML.cxx b/lexers/LexHTML.cxx
index 3793b1185..ebfd7302e 100644
--- a/lexers/LexHTML.cxx
+++ b/lexers/LexHTML.cxx
@@ -479,10 +479,6 @@ static bool isLineEnd(int ch) {
return ch == '\r' || ch == '\n';
}
-static bool isOKBeforeRE(int ch) {
- return (ch == '(') || (ch == '=') || (ch == ',');
-}
-
static bool isMakoBlockEnd(const int ch, const int chNext, const char *blockType) {
if (strlen(blockType) == 0) {
return ((ch == '%') && (chNext == '>'));
@@ -686,6 +682,8 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
const CharacterSet setHTMLWord(CharacterSet::setAlphaNum, ".-_:!#", 0x80, true);
const CharacterSet setTagContinue(CharacterSet::setAlphaNum, ".-_:!#[", 0x80, true);
const CharacterSet setAttributeContinue(CharacterSet::setAlphaNum, ".-_:!#/", 0x80, true);
+ // TODO: also handle + and - (except if they're part of ++ or --) and return keywords
+ const CharacterSet setOKBeforeJSRE(CharacterSet::setNone, "([{=,:;!%^&*|?~");
int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
int levelCurrent = levelPrev;
@@ -1587,7 +1585,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
} else if (ch == '/' && chNext == '/') {
styler.ColourTo(i - 1, StateToPrint);
state = SCE_HJ_COMMENTLINE;
- } else if (ch == '/' && isOKBeforeRE(chPrevNonWhite)) {
+ } else if (ch == '/' && setOKBeforeJSRE.Contains(chPrevNonWhite)) {
styler.ColourTo(i - 1, StateToPrint);
state = SCE_HJ_REGEX;
} else if (ch == '\"') {