Implement the housekeeping verbs, and stop the REPL spinning after an error
NEW, CLR, CONT, SWAP, TRON, TROFF and HELP. None is in the Go reference, so what each means here is recorded beside it. Testing CONT turned up a hang that predates this: the runtime's error class is deliberately sticky, and with run_finished_mode REPL every later step re-entered REPL and printed READY -- overwriting the QUIT that end of input had just set. An interactive session that hit one runtime error printed READY forever instead of exiting. RESTORE and RENUMBER are deferred with reasons; RESTORE turns out to need a DATA pointer this port does not have, which is a defect in its own right. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -139,6 +139,28 @@ typedef struct akbasic_Runtime
|
||||
*/
|
||||
bool skiprestofline;
|
||||
|
||||
/*
|
||||
* TRON/TROFF. When set, every line prints its number in brackets before it
|
||||
* runs, inline and with no newline, which is what a C128 does: a traced
|
||||
* program's output reads `[10][20]HELLO`.
|
||||
*/
|
||||
bool trace;
|
||||
|
||||
/*
|
||||
* CONT's two pieces. `stopped` says a STOP actually happened, so CONT can
|
||||
* refuse rather than silently starting a program that was never running;
|
||||
* `stoppedline` is where to pick up, taken before STOP hands control back to
|
||||
* the REPL and the environment's line counters move on.
|
||||
*/
|
||||
bool stopped;
|
||||
int64_t stoppedline;
|
||||
|
||||
/*
|
||||
* The line the last BASIC-visible error was reported on, and 0 if there has
|
||||
* not been one. HELP re-displays it, which is the whole of what HELP does.
|
||||
*/
|
||||
int64_t errorline;
|
||||
|
||||
/* REPL line assembly */
|
||||
char userline[AKBASIC_MAX_LINE_LENGTH];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user