diff options
author | B. Watson <urchlay@slackware.uk> | 2024-07-16 22:58:00 -0400 |
---|---|---|
committer | B. Watson <urchlay@slackware.uk> | 2024-07-16 22:58:00 -0400 |
commit | b094b4106cd84af88b2bb279db93cdc7c4020c6a (patch) | |
tree | a60e0064c09d0650b2d8ff3c6f9b6aaa354af962 | |
parent | e74f3deaaec738bf23f5cbadafa9ddcec51388b6 (diff) | |
download | bw-atari8-tools-b094b4106cd84af88b2bb279db93cdc7c4020c6a.tar.gz |
bas.c: clean up on_text logic.
-rw-r--r-- | bas.c | 35 |
1 files changed, 12 insertions, 23 deletions
@@ -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 */ |