Skip to content

Commit 9b777b9

Browse files
committed
ScintillaOrg#338 Remove nonEmptySegment check.
1 parent d4b3eef commit 9b777b9

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

lexers/LexHTML.cxx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2262,6 +2262,7 @@ void SCI_METHOD LexerHTML::Lex(Sci_PositionU startPos, Sci_Position length, int
22622262
} else if (ch == '\"') {
22632263
styler.ColourTo(i, statePrintForState(SCE_HJ_DOUBLESTRING, inScriptType));
22642264
state = SCE_HJ_DEFAULT;
2265+
continue;
22652266
} else if (isLineEnd(ch)) {
22662267
styler.ColourTo(i - 1, StateToPrint);
22672268
if (chPrev != '\\' && (chPrev2 != '\\' || chPrev != '\r' || ch != '\n')) {
@@ -2277,6 +2278,7 @@ void SCI_METHOD LexerHTML::Lex(Sci_PositionU startPos, Sci_Position length, int
22772278
} else if (ch == '\'') {
22782279
styler.ColourTo(i, statePrintForState(SCE_HJ_SINGLESTRING, inScriptType));
22792280
state = SCE_HJ_DEFAULT;
2281+
continue;
22802282
} else if (isLineEnd(ch)) {
22812283
styler.ColourTo(i - 1, StateToPrint);
22822284
if (chPrev != '\\' && (chPrev2 != '\\' || chPrev != '\r' || ch != '\n')) {
@@ -2292,6 +2294,7 @@ void SCI_METHOD LexerHTML::Lex(Sci_PositionU startPos, Sci_Position length, int
22922294
} else if (ch == '`') {
22932295
styler.ColourTo(i, statePrintForState(SCE_HJ_TEMPLATELITERAL, inScriptType));
22942296
state = SCE_HJ_DEFAULT;
2297+
continue;
22952298
}
22962299
break;
22972300
case SCE_HJ_STRINGEOL:
@@ -2359,6 +2362,7 @@ void SCI_METHOD LexerHTML::Lex(Sci_PositionU startPos, Sci_Position length, int
23592362
if (ch == '\"') {
23602363
styler.ColourTo(i, StateToPrint);
23612364
state = SCE_HB_DEFAULT;
2365+
continue;
23622366
} else if (ch == '\r' || ch == '\n') {
23632367
styler.ColourTo(i - 1, StateToPrint);
23642368
state = SCE_HB_STRINGEOL;
@@ -2656,12 +2660,10 @@ void SCI_METHOD LexerHTML::Lex(Sci_PositionU startPos, Sci_Position length, int
26562660
///////////// end - PHP state handling
26572661
}
26582662

2659-
// Some of the above terminated their lexeme but since the same character starts
2660-
// the same class again, only reenter if non empty segment.
2663+
// Some of the above terminated their lexeme
26612664

2662-
const bool nonEmptySegment = i >= static_cast<Sci_Position>(styler.GetStartSegment());
26632665
if (state == SCE_HB_DEFAULT) { // One of the above succeeded
2664-
if ((ch == '\"') && (nonEmptySegment)) {
2666+
if (ch == '\"') {
26652667
state = SCE_HB_STRING;
26662668
} else if (ch == '\'') {
26672669
state = SCE_HB_COMMENTLINE;
@@ -2679,11 +2681,11 @@ void SCI_METHOD LexerHTML::Lex(Sci_PositionU startPos, Sci_Position length, int
26792681
state = SCE_HJ_COMMENT;
26802682
} else if (ch == '/' && chNext == '/') {
26812683
state = SCE_HJ_COMMENTLINE;
2682-
} else if ((ch == '\"') && (nonEmptySegment)) {
2684+
} else if (ch == '\"') {
26832685
state = SCE_HJ_DOUBLESTRING;
2684-
} else if ((ch == '\'') && (nonEmptySegment)) {
2686+
} else if (ch == '\'') {
26852687
state = SCE_HJ_SINGLESTRING;
2686-
} else if ((ch == '`') && (nonEmptySegment)) {
2688+
} else if (ch == '`') {
26872689
state = SCE_HJ_TEMPLATELITERAL;
26882690
} else if (IsAWordStart(ch)) {
26892691
state = SCE_HJ_WORD;

0 commit comments

Comments
 (0)