aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/LexHTML.cxx
diff options
context:
space:
mode:
authornyamatongwe <unknown>2000-05-27 02:16:49 +0000
committernyamatongwe <unknown>2000-05-27 02:16:49 +0000
commit2f0d3718f7d4af752b10fc586507c2b1c25f6ffe (patch)
tree45ee1f8c8d83133fdce122b35674bb86bf507ecb /src/LexHTML.cxx
parentd78209cfaac6af11a56e460aa264ec38e4607c99 (diff)
downloadscintilla-mirror-2f0d3718f7d4af752b10fc586507c2b1c25f6ffe.tar.gz
Changed operator bool in WordList to return false if WordList is empty.
Many lexer changes from Philippe Lhoste. VB handles preprocessor and hex constants. C++ optionally leaves preprocessor state after the preprocessor command. HTML terminates incomplete entities earlier and marks them as bad attributes.
Diffstat (limited to 'src/LexHTML.cxx')
-rw-r--r--src/LexHTML.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/LexHTML.cxx b/src/LexHTML.cxx
index 0b31cba39..9a9377292 100644
--- a/src/LexHTML.cxx
+++ b/src/LexHTML.cxx
@@ -54,6 +54,9 @@ static void classifyAttribHTML(unsigned int start, unsigned int end, WordList &k
if (keywords.InList(s))
chAttr = SCE_H_ATTRIBUTE;
}
+ if ((chAttr == SCE_H_ATTRIBUTEUNKNOWN) && !keywords)
+ // No keywords -> all are known
+ chAttr = SCE_H_ATTRIBUTE;
styler.ColourTo(end, chAttr);
}
@@ -81,6 +84,9 @@ static int classifyTagHTML(unsigned int start, unsigned int end,
chAttr = SCE_H_SCRIPT;
}
}
+ if ((chAttr == SCE_H_TAGUNKNOWN) && !keywords)
+ // No keywords -> all are known
+ chAttr = SCE_H_TAG;
styler.ColourTo(end, chAttr);
return chAttr;
}
@@ -353,13 +359,10 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
styler.ColourTo(i, state);
state = SCE_H_DEFAULT;
}
-#ifdef OLD /* PL 2000/05/18 -- An bad entity may stop on a non-alphabetic character */
-#else /* OLD PL 2000/05/18 */
if (ch != '#' && !isalnum(ch)) { // Should check that '#' follows '&', but it is unlikely anyway...
styler.ColourTo(i, SCE_H_TAGUNKNOWN);
state = SCE_H_DEFAULT;
}
-#endif /* OLD PL 2000/05/18 */
} else if (state == SCE_H_TAGUNKNOWN) {
if (!ishtmlwordchar(ch) && ch != '/' && ch != '-') {
int eClass = classifyTagHTML(styler.GetStartSegment(), i - 1, keywords, styler);
@@ -368,7 +371,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
scriptLanguage = eScriptJS;
eClass = SCE_H_TAG;
}
- if (ch == '>') {
+ if ((ch == '>') && (eClass != SCE_H_COMMENT)) {
styler.ColourTo(i, SCE_H_TAG);
if (lastTagWasScript) {
if (scriptLanguage == eScriptVBS)