aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-07-07 05:16:05 -0400
committerB. Watson <urchlay@slackware.uk>2024-07-07 05:16:05 -0400
commit4cc4f909a55b470fcdef9e61456fb161ed7f5759 (patch)
tree9587f6f9df689de822d0be93db648f58783caa8b
parent0e25dbd121738993ac0bb455547a8fbcb621a780 (diff)
downloadbw-atari8-tools-4cc4f909a55b470fcdef9e61456fb161ed7f5759.tar.gz
whichbas: add partial support for DIB/RANDOM( op.
-rw-r--r--whichbas.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/whichbas.c b/whichbas.c
index 1758c30..85a9038 100644
--- a/whichbas.c
+++ b/whichbas.c
@@ -275,8 +275,8 @@ CALLBACK(handle_op) {
}
}
+ /* 59: INKEY$ (pseudo-function) in TB, string array separator semicolon in BXL/BXE */
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);
@@ -284,15 +284,15 @@ CALLBACK(handle_op) {
}
/* 5a: EXOR (infix num op) or BUMP( (pseudo-function, no OP_FUNC_LPAR) */
- if(tok == 0x5a) {
+ /* 5d: DIV (infix num op) or RANDOM( (pseudo-func, 1 or 2 num args) */
+ if(tok == 0x5a || tok == 0x5d) {
/* XXX: incomplete */
if(last_cmd_pos == pos - 1) {
- /* partial: if the last token was a command, this *can't*
- be EXOR (it's infix). */
+ /* partial: if the last token was a command, this *can't* be infix.*/
remove_type(BT_TURBO);
} else if(program[pos - 1] >= 0x80) {
/* partial: if the last token was a variable, this can't
- be BUMP (it's a function, last token has to be a command
+ be a function (last token would have to have been a command
or a regular operator). however, Turbo BASIC allows up to 256
variables, this only catches the first 128. */
remove_type(BT_BXL_BXE);
@@ -319,7 +319,7 @@ CALLBACK(handle_op) {
}
}
- /* 5d: DIV (infix num op) or RANDOM( (pseudo-func, 1 or 2 num args) */
+ /* 5d: see 5a, above (same logic). */
/* 5e! FRAC (num func, 1 arg) or DPEEK (num func, 1 arg), can't tell apart :( */
if(tok == 0x5f) {