From b094b4106cd84af88b2bb279db93cdc7c4020c6a Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Tue, 16 Jul 2024 22:58:00 -0400 Subject: bas.c: clean up on_text logic. --- bas.c | 35 ++++++++++++----------------------- 1 file changed, 12 insertions(+), 23 deletions(-) diff --git a/bas.c b/bas.c index b3893fe..cf03f38 100644 --- a/bas.c +++ b/bas.c @@ -377,29 +377,18 @@ void walk_code(unsigned int startlineno, unsigned int endlineno) { pos++; CALL(on_cmd_token); - switch(program[pos]) { - case 0x5a: - if(bxl_exttok_hack) pos++; /* skip subtoken */ - pos++; - break; - case CMD_REM: - case CMD_DATA: - case CMD_ERROR: - pos++; - CALL(on_text); - pos = end; - break; - case 0x53: /* BASIC/A+'s ERROR- token */ - if(aplus_errtok_hack) { - pos++; - CALL(on_text); - pos = end; - break; - } - /* fall thru */ - default: - pos++; - break; + tok = program[pos]; + if((tok == CMD_REM) || (tok == CMD_DATA) || /* same in A+ */ + (aplus_errtok_hack && tok == 0x53) || /* A+'s ERROR- */ + (!aplus_errtok_hack && tok == CMD_ERROR)) + { + pos++; + CALL(on_text); + pos = end; + } else if(bxl_exttok_hack && tok == 0x5a) { + pos += 2; /* skip subtoken */ + } else { + pos++; } while(pos < end) { /* loop over operators */ -- cgit v1.2.3