Attempt to recover from syntax errors with bison

Fixes #595
This commit is contained in:
Rangi
2021-01-21 09:36:10 -05:00
committed by Eldred Habert
parent a679e02246
commit e3d355d976
10 changed files with 72 additions and 4 deletions

View File

@@ -506,6 +506,12 @@ void fstk_RunFor(char const *symName, int32_t start, int32_t stop, int32_t step,
fatalerror("Not enough memory for FOR symbol name: %s\n", strerror(errno));
}
void fstk_StopRept(void)
{
/* Prevent more iterations */
contextStack->nbReptIters = 0;
}
bool fstk_Break(void)
{
dbgPrint("Breaking out of REPT/FOR\n");
@@ -515,8 +521,7 @@ bool fstk_Break(void)
return false;
}
/* Prevent more iterations */
contextStack->nbReptIters = 0;
fstk_StopRept();
return true;
}