aboutsummaryrefslogtreecommitdiff
path: root/bas.c
diff options
context:
space:
mode:
Diffstat (limited to 'bas.c')
-rw-r--r--bas.c40
1 files changed, 17 insertions, 23 deletions
diff --git a/bas.c b/bas.c
index b3893fe..e5df296 100644
--- a/bas.c
+++ b/bas.c
@@ -377,34 +377,28 @@ 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 */
tok = program[pos];
switch(tok) {
+ case 0: /* Turbo variables numbered >= $80 */
+ CALL(on_exp_token);
+ /* on_exp_token callback better know what to do with $00! */
+ pos += 2;
+ break;
case OP_NUMCONST:
CALL(on_exp_token);
pos++;