aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-07-07 04:44:13 -0400
committerB. Watson <urchlay@slackware.uk>2024-07-07 04:44:13 -0400
commitf97bee398b26ce9f5aa2883ea95a3a31ad436fa5 (patch)
tree6322a545ff4027f9a7dc9fb2d4856df237c554e6
parent98f3c16ecdcea547046b320316f4e79aa200dde4 (diff)
downloadbw-atari8-tools-f97bee398b26ce9f5aa2883ea95a3a31ad436fa5.tar.gz
whichbas: add a few more operators, document the rest.
-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) {