Recover from errors even inside REPT/FOR loops (#1683)

This commit is contained in:
Rangi authored and GitHub committed 2025-05-04 17:51:53 -04:00
1 parent e1ae92709c
commit e95ac6fb06
6 files changed
+12 -10

No files matched your search

+1 -5
View File
@@ -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;
}