mirror of
https://github.com/gbdev/rgbds.git
synced 2026-10-07 04:35:37 +00:00
1 parent
46d6652df1
commit
aa99ed056c
6 files changed
+38
-2
No files matched your search
@@ -1856,6 +1856,8 @@ static char const *reportGarbageChar(unsigned char firstByte)
|
||||
|
||||
/* Lexer core */
|
||||
|
||||
static int yylex_SKIP_TO_ENDC(void); // forward declaration for yylex_NORMAL
|
||||
|
||||
static int yylex_NORMAL(void)
|
||||
{
|
||||
dbgPrint("Lexing in normal mode, line=%" PRIu32 ", col=%" PRIu32 "\n",
|
||||
@@ -2085,6 +2087,12 @@ static int yylex_NORMAL(void)
|
||||
if (startsIdentifier(c)) {
|
||||
int tokenType = readIdentifier(c);
|
||||
|
||||
/* An ELIF after a taken IF needs to not evaluate its condition */
|
||||
if (tokenType == T_POP_ELIF && lexerState->lastToken == T_NEWLINE
|
||||
&& lexer_GetIFDepth() > 0 && lexer_RanIFBlock()
|
||||
&& !lexer_ReachedELSEBlock())
|
||||
return yylex_SKIP_TO_ENDC();
|
||||
|
||||
/* If a keyword, don't try to expand */
|
||||
if (tokenType != T_ID && tokenType != T_LOCAL_ID)
|
||||
return tokenType;
|
||||
|
||||
Reference in new issue
Block a user