From d34148b6aa1948d42373c290cc168df015978de4 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Sun, 7 Jul 2024 05:05:38 -0400 Subject: whichbas: add partial support for EXOR/BUMP( op. --- whichbas.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'whichbas.c') 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) { -- cgit v1.2.3