diff options
-rw-r--r-- | whichbas.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -235,6 +235,14 @@ CALLBACK(handle_op) { if(verbose) fprintf(stderr, "handle_op: lineno %d, tok $%02x, comma_count %d, bas_type was %02x\n", lineno, tok, comma_count, bas_type); + if(tok == 0x00) { + /* Turbo allows 256 variables, tokenizes the first 128 normally ($80-$FF). + The extra ones above $FF are tokenized as $00, varnum - $80. None of + our other BASICs uses $00 as an operator token, so.. */ + bas_type = BT_TURBO; + print_result(); + } + if(tok == OP_HEXCONST) remove_type(BT_ATARI); /* hex const (turbo *and* bxl/xe) */ if(tok <= OP_FUNC_STRIG) { if(verbose) fprintf(stderr, " bas_type now %02x\n", bas_type); @@ -351,6 +359,8 @@ CALLBACK(handle_op) { if(verbose) fprintf(stderr, " bas_type now %02x\n", bas_type); } +/* we can count commas, because both Turbo and BXE/BXL use the "array" comma + to separate function arguments, not the "regular" comma. */ CALLBACK(handle_end_stmt) { if(verbose) fprintf(stderr, "handle_end_stmt: lineno %d, tok $%02x, last_cmd $%02x, comma_count %d, bas_type was %02x\n", lineno, tok, last_cmd, comma_count, bas_type); switch(last_cmd) { |