+ fix: possible busy-loop in Kotlin and Dard Lexer

This commit is contained in:
Rainer Kottenhoff 2021-03-25 17:04:47 +01:00
parent dc834e4011
commit 5335074072
2 changed files with 3 additions and 3 deletions

View File

@ -409,7 +409,7 @@ void SCI_METHOD LexerDart::Lex(Sci_PositionU startPos, Sci_Position length, int
}
else {
//?const int chNext = GetNextNSChar();
while (IsASpace(sc.ch)){ sc.Forward(); };
while (IsASpace(sc.ch) && sc.More()){ sc.Forward(); };
if (sc.ch == '(') {
sc.ChangeState(SCE_DART_FUNCTION);
}

View File

@ -418,7 +418,7 @@ void SCI_METHOD LexerKotlin::Lex(Sci_PositionU startPos, Sci_Position length, in
if (kwType != SCE_KOTLIN_DEFAULT)
{
//?const int chNext = sc.GetNextNSChar();
while (IsASpace(sc.ch)) { sc.Forward(); };
while (IsASpace(sc.ch) && sc.More()) { sc.Forward(); };
if (!((kwType == SCE_KOTLIN_LABEL && sc.ch == '@') || (kwType != SCE_KOTLIN_LABEL && IsIdentifierStart(sc.ch))))
{
kwType = SCE_KOTLIN_DEFAULT;
@ -450,7 +450,7 @@ void SCI_METHOD LexerKotlin::Lex(Sci_PositionU startPos, Sci_Position length, in
}
else
{
while (IsASpace(sc.ch)) { sc.Forward(); };
while (IsASpace(sc.ch) && sc.More()) { sc.Forward(); };
if (sc.ch == '(') {
sc.ChangeState(SCE_KOTLIN_FUNCTION);
}