From 1bd855fab40bc8d97ddd1f5cc263f3e3e2c1e3cb Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Sat, 27 May 2000 02:16:49 +0000 Subject: 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. --- src/LexHTML.cxx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/LexHTML.cxx') 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) -- cgit v1.2.3