mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Recover from errors even inside REPT/FOR loops (#1683)
This commit is contained in:
@@ -392,17 +392,13 @@ void fstk_RunFor(
|
||||
context.forName = symName;
|
||||
}
|
||||
|
||||
void fstk_StopRept() {
|
||||
contextStack.top().nbReptIters = 0; // Prevent more iterations
|
||||
}
|
||||
|
||||
bool fstk_Break() {
|
||||
if (contextStack.top().fileInfo->type != NODE_REPT) {
|
||||
error("BREAK can only be used inside a REPT/FOR block\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
fstk_StopRept();
|
||||
contextStack.top().nbReptIters = 0; // Prevent more iterations
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -425,7 +425,6 @@ lines:
|
||||
lexer_SetMode(LEXER_NORMAL);
|
||||
lexer_ToggleStringExpansion(true);
|
||||
} endofline {
|
||||
fstk_StopRept();
|
||||
yyerrok;
|
||||
}
|
||||
;
|
||||
|
||||
Reference in New Issue
Block a user