aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-07-09 14:56:01 -0400
committerB. Watson <urchlay@slackware.uk>2024-07-09 14:56:01 -0400
commit29a78b75bc03b23110339dca992bbc454d736e0a (patch)
treee64362febcf0d492209334cb564ebeca2940e312
parentad7fcd0a3f92f758c8decda880de76d26982cf9d (diff)
downloadbw-atari8-tools-29a78b75bc03b23110339dca992bbc454d736e0a.tar.gz
whichbas: simplify TRACE/EXTEND logic.
-rw-r--r--whichbas.c33
1 files 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 */