Implement BREAK to exit REPT and FOR loops

Fixes #684
This commit is contained in:
Rangi
2021-01-03 22:00:02 -05:00
committed by Eldred Habert
parent 7ce5cf1595
commit 62bea23c49
13 changed files with 204 additions and 7 deletions

View File

@@ -463,6 +463,7 @@ static inline void failAssertMsg(enum AssertionType type, char const *msg)
%token T_POP_POPC
%token T_POP_SHIFT
%token T_POP_ENDR
%token T_POP_BREAK
%token T_POP_LOAD T_POP_ENDL
%token T_POP_FAIL
%token T_POP_WARN
@@ -684,6 +685,7 @@ simple_pseudoop : include
| rept
| for
| shift
| break
| fail
| warn
| assert
@@ -832,6 +834,12 @@ for_args : const {
}
;
break : T_POP_BREAK {
if (fstk_Break())
lexer_SetMode(LEXER_SKIP_TO_ENDR);
}
;
macrodef : T_LABEL T_COLON T_POP_MACRO {
int32_t nDefinitionLineNo = lexer_GetLineNo();
char *body;