aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-07-07 17:02:25 -0400
committerB. Watson <urchlay@slackware.uk>2024-07-07 17:02:25 -0400
commit56b692064dccfac72295273166176115e66e52ba (patch)
tree935aad8d312b3ea8caa5665c193c2595923dcdb0
parentfd0a11afe23e34c223420009467c3ced750416d5 (diff)
downloadbw-atari8-tools-56b692064dccfac72295273166176115e66e52ba.tar.gz
whichbas: handle undocumented extra END token in BASIC XL.
-rw-r--r--whichbas.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/whichbas.c b/whichbas.c
index 75867e1..e05fcd5 100644
--- a/whichbas.c
+++ b/whichbas.c
@@ -275,10 +275,16 @@ CALLBACK(handle_op) {
switch(tok) {
case 0x55: /* DPEEK (function) TB, USING (infix, not a function) in BXL/BXE */
- case 0x58: /* INSTR (function) or & (infix numeric) */
+ case 0x58: /* INSTR (function) or & (infix numeric) in BXE. Note that
+ BXL has this as another END token, which works like the
+ regular END, but cannot be entered in the editor so unlikely
+ to show up in a program (but we handle it here anyway) */
case 0x5b: /* HEX$ (func, takes 1 num arg) or FIND( (pseudo-func, 3 args */
if(nexttok == OP_FUNC_LPAR) {
remove_type(BT_BXL_BXE);
+ } else if(nexttok == OP_EOS || nexttok == OP_EOL) {
+ /* weird BXL END token */
+ remove_type(BT_TURBO | BT_BXE);
} else {
remove_type(BT_TURBO);
}