From 29a78b75bc03b23110339dca992bbc454d736e0a Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Tue, 9 Jul 2024 14:56:01 -0400 Subject: whichbas: simplify TRACE/EXTEND logic. --- whichbas.c | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/whichbas.c b/whichbas.c index 9d3c283..ef2c55b 100644 --- a/whichbas.c +++ b/whichbas.c @@ -256,24 +256,21 @@ CALLBACK(handle_cmd) { break; case 0x58: /* TRACE (optional + or -), EXTEND (BXE; no args) */ /* COMPLETE */ - if(nexttok == OP_PLUS || nexttok == OP_MINUS) { - bas_type = BT_TURBO; - print_result(); - } else { - /* In BXL, this looks to be an extra END token, that behaves the same - as the regular one, but can't be entered in the editor. Assume - no BXL program contains this token. */ - remove_type(BT_BXL); - /* In BXE, EXTEND can't actually appear in a program (it's direct - mode only). The only way to get EXTEND into a BXE program is - to do a direct mode command like: - EXTEND:SAVE "D:PROG" - ...which of course puts it at line 32768. But this code will - never see that, because we'd already detect EXTENDed BXE - based on the first 2 bytes of the file. - */ - remove_type(BT_BXE); - } + /* In BXL, this looks to be an extra END token, that behaves the same + as the regular one, but can't be entered in the editor. Assume + no BXL program contains this token. */ + /* In BXE, EXTEND can't actually appear in a program (it's direct + mode only). The only way to get EXTEND into a BXE program is + to do a direct mode command like: + EXTEND:SAVE "D:PROG" + ...which of course puts it at line 32768. But this code will + never see that, because we'd already detect EXTENDed BXE + based on the first 2 bytes of the file. + */ + /* So, if we see this token, it *has* to be Turbo's TRACE, whether + or not it has an argument. */ + bas_type = BT_TURBO; + print_result(); break; case 0x59: /* TEXT or PROCEDURE */ /* COMPLETE */ -- cgit v1.2.3