diff options
-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 */ |