mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Reduce nesting depth in lexer.cpp
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user