aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-07-07 05:05:38 -0400
committerB. Watson <urchlay@slackware.uk>2024-07-07 05:05:38 -0400
commitd34148b6aa1948d42373c290cc168df015978de4 (patch)
tree8e5dae2d1af6bacbf369196e8c7532fc4a7355b4
parent96dc62e466855ba951ea4d89f75e7f081af02987 (diff)
downloadbw-atari8-tools-d34148b6aa1948d42373c290cc168df015978de4.tar.gz
whichbas: add partial support for EXOR/BUMP( op.
-rw-r--r--whichbas.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/whichbas.c b/whichbas.c
index 8f44998..d4608ba 100644
--- a/whichbas.c
+++ b/whichbas.c
@@ -284,6 +284,23 @@ CALLBACK(handle_op) {
}
/* 5a: EXOR (infix num op) or BUMP( (pseudo-function, no OP_FUNC_LPAR) */
+ if(tok == 0x5a) {
+ /* XXX: incomplete */
+ if(last_cmd_pos == pos - 1) {
+ /* partial: if the last token was a command, this *can't*
+ be EXOR (it's infix). */
+ remove_type(BT_TURBO);
+ /* this won't quite work: */
+ /* } else if(program[pos - 1] == OP_NUM_ASSIGN) {
+ 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
+ or a regular operator). however, Turbo BASIC allows up to 256
+ variables, this only catches the first 128. */
+ remove_type(BT_BXL_BXE);
+ }
+ }
/* 5b: HEX$ (func, takes 1 num arg) or FIND( (pseudo-func, 3 args */
if(tok == 0x5b) {