diff options
-rw-r--r-- | whichbas.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -180,6 +180,7 @@ int is_arith_op(unsigned char tok) { case OP_NUM_ASSIGN: case OP_UPLUS: case OP_UMINUS: + case OP_GRP_LPAR: /* yes, this belongs here, (((A$))) is a syntax error! */ return 1; default: return 0; @@ -228,6 +229,7 @@ int is_string_exp_op(unsigned char tok) { case OP_STR_LT: case OP_STR_GT: case OP_STR_EQ: + case OP_STR_LPAR: /* the ( in: A$(1)="A" */ return 1; default: return 0; @@ -713,7 +715,15 @@ CALLBACK(handle_op) { break; case 0x5c: /* DEC (function, takes str) in TB, HEX$ (function, takes num) in BXL/BXE */ + if(is_string_op(nexttok2)) { + remove_type(BT_BXL_BXE); + } else if(is_numeric_op(nexttok2)) { + remove_type(BT_TURBO); + } + + /* old implementation: */ /* PARTIAL: won't catch HEX$(ASC("A")) (or any other nested function call) */ + /* if(nexttok2 == OP_STRCONST) { remove_type(BT_BXL_BXE); } else if(nexttok2 == OP_NUMCONST) { @@ -725,6 +735,7 @@ CALLBACK(handle_op) { remove_type(BT_TURBO); } } + */ break; case 0x5e: /* FRAC (num func, 1 arg) or DPEEK (num func, 1 arg) in BXL... |