aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--whichbas.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/whichbas.c b/whichbas.c
index fc39609..8bd6d9a 100644
--- a/whichbas.c
+++ b/whichbas.c
@@ -252,13 +252,40 @@ CALLBACK(handle_op) {
print_result();
}
+ /* FIXME: I should have written this as a switch, not a bunch of if's */
+
if(tok == 0x55) {
/* DPEEK (function) TB, USING (infix, not a function) in BXL/BXE */
if(nexttok == OP_FUNC_LPAR) {
remove_type(BT_BXL_BXE);
+ } else {
+ remove_type(BT_TURBO);
+ }
+ }
+
+ /* 56! & (logical AND) or % (XOR), both infix numeric ops; can't tell apart */
+ /* 57! ! (logical OR) in both Turbo and BXL/BXE, can't tell apart */
+
+ /* 58: INSTR (function) or & (infix numeric) */
+ if(tok == 0x58) {
+ if(nexttok == OP_FUNC_LPAR) {
+ remove_type(BT_BXL_BXE);
+ } else {
+ remove_type(BT_TURBO);
+ }
+ }
+
+ if(tok == 0x59) {
+ /* INKEY$ (pseudo-function) in TB, string array separator semicolon in BXL/BXE */
+ if(nexttok == OP_NUMCONST || nexttok >= 0x80) {
+ /* INKEY$ may not be followed by a numeric constant or a variable of any kind */
+ remove_type(BT_TURBO);
}
}
+ /* 5a: EXOR (infix num op) or BUMP( (pseudo-function, no OP_FUNC_LPAR) */
+ /* 5b: HEX$ (func, takes 1 num arg) or FIND( (pseudo-func, 3 args */
+
if(tok == 0x5c) {
/* DEC (function, takes str) in TB, HEX$ (function, takes num) in BXL/BXE */
if(nexttok2 == OP_STRCONST) {
@@ -269,6 +296,9 @@ CALLBACK(handle_op) {
}
}
+ /* 5d: DIV (infix num op) or RANDOM( (pseudo-func, 1 or 2 num args) */
+ /* 5e! FRAC (num func, 1 arg) or DPEEK (num func, 1 arg), can't tell apart :( */
+
if(tok == 0x5f) {
/* TIME$ in TB, SYS (function) in BXL/BXE */
if(nexttok == OP_FUNC_LPAR) {
@@ -295,6 +325,10 @@ CALLBACK(handle_op) {
remove_type(BT_TURBO);
}
+ /* 63! RND (func, 1 num arg) or ERR (func, 1 num arg), can't tell apart */
+ /* 64! RAND (func, 1 num arg) or TAB (func, 1 num arg), can't tell apart */
+ /* 65! TRUNC (func, 1 num arg) or PEN (func, 1 num arg), can't tell apart */
+
if(tok == 0x66 || tok == 0x67 || tok == 0x68) {
/* either %0 %1 %2 (TB), or LEFT$ RIGHT$ MID$ (BXL/XE) */
if(nexttok == OP_STRCONST || nexttok >= 0x80) {