Reduce nesting depth in lexer.cpp

This commit is contained in:
Rangi42
2025-07-12 07:54:16 -04:00
parent d32b1912ed
commit da133baf17

View File

@@ -1953,9 +1953,14 @@ static Token yylex_NORMAL() {
bool raw = c == '#';
if (raw && startsIdentifier(peek())) {
c = nextChar();
} else if (!startsIdentifier(c)) {
// Do not report weird characters when capturing, it'll be done later
if (!lexerState->capturing) {
reportGarbageCharacters(c);
}
break;
}
if (startsIdentifier(c)) {
Token token = readIdentifier(c, raw);
// An ELIF after a taken IF needs to not evaluate its condition
@@ -2004,12 +2009,6 @@ static Token yylex_NORMAL() {
return token;
}
// Do not report weird characters when capturing, it'll be done later
if (!lexerState->capturing) {
reportGarbageCharacters(c);
}
}
lexerState->atLineStart = false;
}
}