diff options
author | nyamatongwe <unknown> | 2005-02-07 05:23:19 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2005-02-07 05:23:19 +0000 |
commit | e9fedb211ceb5aeb36fc59bbf4a7de61ea80bff0 (patch) | |
tree | 5b05243624ad9dd8bfd8fdf5b5e352d6d9f1d850 /src/LexHTML.cxx | |
parent | f31a2e803d28c50dd3cbc2838c93d692d86ee5e0 (diff) | |
download | scintilla-mirror-e9fedb211ceb5aeb36fc59bbf4a7de61ea80bff0.tar.gz |
Fix for three bugs from Iago Rubio. Mailing list thread "Scite HTML/ASP/JScript again".
Diffstat (limited to 'src/LexHTML.cxx')
-rw-r--r-- | src/LexHTML.cxx | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/LexHTML.cxx b/src/LexHTML.cxx index e3546b436..5a390bf2a 100644 --- a/src/LexHTML.cxx +++ b/src/LexHTML.cxx @@ -406,6 +406,11 @@ static bool IsCommentState(const int state) { return state == SCE_H_COMMENT || state == SCE_H_SGML_COMMENT; } +static bool IsScriptCommentState(const int state) { + return state == SCE_HJ_COMMENT || state == SCE_HJ_COMMENTLINE || state == SCE_HJA_COMMENT || + state == SCE_HJA_COMMENTLINE || state == SCE_HB_COMMENTLINE || state == SCE_HBA_COMMENTLINE; +} + static bool isLineEnd(char ch) { return ch == '\r' || ch == '\n'; } @@ -607,7 +612,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty case SCE_HJ_COMMENTDOC: // SCE_HJ_COMMENTLINE removed as this is a common thing done to hide // the end of script marker from some JS interpreters. - //case SCE_HJ_COMMENTLINE: + case SCE_HJ_COMMENTLINE: case SCE_HJ_DOUBLESTRING: case SCE_HJ_SINGLESTRING: case SCE_HJ_REGEX: @@ -636,7 +641,8 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty !isPHPStringState(state) && (state != SCE_HPHP_COMMENT) && (ch == '<') && - (chNext == '?')) { + (chNext == '?') && + !IsScriptCommentState(state) ) { scriptLanguage = segIsScriptingIndicator(styler, styler.GetStartSegment() + 2, i + 10, eScriptPHP); if (scriptLanguage != eScriptPHP && isStringState(state)) continue; styler.ColourTo(i - 1, StateToPrint); @@ -708,7 +714,9 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty else if (((scriptLanguage == eScriptNone) || (scriptLanguage == eScriptXML)) && (chPrev == '<') && (ch == '!') && - (StateToPrint != SCE_H_CDATA) && (!IsCommentState(StateToPrint))) { + (StateToPrint != SCE_H_CDATA) && + (!IsCommentState(StateToPrint)) && + (!IsScriptCommentState(StateToPrint)) ) { beforePreProc = state; styler.ColourTo(i - 2, StateToPrint); if ((chNext == '-') && (chNext2 == '-')) { |