From 655385f76513f5df6ce2263c297a2d5955581f87 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Wed, 10 Jul 2024 00:12:35 -0400 Subject: whichbas: code cosmetics. --- whichbas.c | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/whichbas.c b/whichbas.c index a4e9fc8..7d8764e 100644 --- a/whichbas.c +++ b/whichbas.c @@ -253,7 +253,8 @@ CALLBACK(handle_cmd) { remove_type(BT_TURBO); } break; - case 0x58: /* TRACE (optional + or -), EXTEND (BXE; no args) */ + + case 0x58: /* TRACE (optional + or -), EXTEND (BXE; no args) */ /* COMPLETE */ /* 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 @@ -270,6 +271,7 @@ CALLBACK(handle_cmd) { or not it has an argument. */ set_type(BT_TURBO); break; + case 0x59: /* TEXT or PROCEDURE */ /* COMPLETE */ /* Turbo: TEXT (1st arg is number), @@ -282,6 +284,7 @@ CALLBACK(handle_cmd) { remove_type(BT_BXL_BXE); } break; + case 0x3f: /* WEND or LOMEM */ case 0x40: /* ELSE or DEL */ case 0x41: /* ENDIF or RPUT */ @@ -295,28 +298,32 @@ CALLBACK(handle_cmd) { remove_type(BT_BXL_BXE); } break; - case 0x48: /* DIR (optional arg) or PROTECT (req'd arg) */ + + case 0x48: /* DIR (optional arg) or PROTECT (req'd arg) */ /* PARTIAL: without args means TB, but with arg, it could be either */ if(!has_args) { remove_type(BT_BXL_BXE); } break; - case 0x4a: /* UNLOCK (req'd arg) or DIR (optional arg) */ + + case 0x4a: /* UNLOCK (req'd arg) or DIR (optional arg) */ /* PARTIAL: without args means BXL/BXE, but with arg, it could be either */ if(!has_args) { remove_type(BT_TURBO); } break; + case 0x3b: /* *F (optional + or -), TRACE (no arg) */ - case 0x5e: /* *B (optional + or -) or EXIT (no arg) */ + case 0x5e: /* *B (optional + or -) or EXIT (no arg) */ /* PARTIAL: doesn't catch *F or *B by itself with no +/- */ if(has_args) { remove_type(BT_BXL_BXE); } break; - case 0x44: /* FILLTO or BGET (check for a # after the token) */ + + case 0x44: /* FILLTO or BGET (check for a # after the token) */ /* COMPLETE */ if(nexttok == OP_HASH) { remove_type(BT_TURBO); @@ -324,7 +331,8 @@ CALLBACK(handle_cmd) { remove_type(BT_BXL_BXE); } break; - case 0x4e: /* TIME$= (1 string arg) or PMCLR (1 num arg) */ + + case 0x4e: /* TIME$= (1 string arg) or PMCLR (1 num arg) */ /* PARTIAL: but almost complete. nothing happens if it's TIME$= with a string function (probably rare) or PMCLR with a complex expression. */ @@ -338,6 +346,7 @@ CALLBACK(handle_cmd) { remove_type(BT_TURBO); } break; + case 0x50: /* EXEC (1 arg, *must* be variable) or PMGRAPHICS (1 num arg, may be const) */ /* PARTIAL: PMGRAPHICS VAR won't be detected. but this usage is rare. */ /* This check is actually redundant, because EXEC requires Turbo's @@ -347,7 +356,8 @@ CALLBACK(handle_cmd) { remove_type(BT_TURBO); } break; - case 0x54: /* -- in TB, LVAR in BXL/BXE */ + + case 0x54: /* -- in TB, LVAR in BXL/BXE */ /* COMPLETE */ /* We can tell these apart because: 1. TB gives us a next-statement offset of 5 if -- is the first (or @@ -368,7 +378,8 @@ CALLBACK(handle_cmd) { remove_type(BT_TURBO); } break; - case 0x57: /* DUMP (1 optional string arg) or LOCAL (1 *numeric* variable arg) */ + + case 0x57: /* DUMP (1 optional string arg) or LOCAL (1 *numeric* variable arg) */ /* BXL/BXE's LOCAL only works on scalars, not arrays or strings. so if there's no arg, or one string arg... */ /* PARTIAL: almost complete, doesn't handle DUMP func$(arg), which I @@ -387,6 +398,7 @@ CALLBACK(handle_cmd) { remove_type(BT_TURBO); } break; + case 0x5a: /* TB: BLOAD; BXL: extension mechanism; BXE: invalid. */ /* This is the token used for the BXL EXTEND.COM added commands, from the Toolkit disk. It's followed by a byte ranging 0x10 @@ -404,6 +416,7 @@ CALLBACK(handle_cmd) { set_type(BT_TURBO); } break; + case 0x5c: /* GO# (1 arg only) or SORTUP (optional 2nd arg of USING, but no comma) */ case 0x5d: /* # (1 arg only) or SORTDOWN (optional 2nd arg of USING, but no comma) */ /* COMPLETE but no longer needed (check_variables() already found the @@ -416,7 +429,8 @@ CALLBACK(handle_cmd) { remove_type(BT_TURBO); } break; - case 0x60: /* CLS (optional IOCB with #) or HITCLR (no args) */ + + case 0x60: /* CLS (optional IOCB with #) or HITCLR (no args) */ /* PARTIAL: without args, can't tell them apart. */ /* I doubt CLS #IOCB is actually used in many Turbo BASIC programs, because it's broken (at least in Turbo 1.5). @@ -426,6 +440,8 @@ CALLBACK(handle_cmd) { if(nexttok == OP_HASH) { remove_type(BT_BXL_BXE); } + break; + default: break; } if(verbose) fprintf(stderr, " bas_type now %02x\n", bas_type); -- cgit v1.2.3