aboutsummaryrefslogtreecommitdiff
path: root/bas.c
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-07-16 03:07:35 -0400
committerB. Watson <urchlay@slackware.uk>2024-07-16 03:07:35 -0400
commit14595634df55b698f0b924e75572df6f0b809555 (patch)
tree6fba647b2d15b33c537b12d3c2a5a0454b734a42 /bas.c
parent9b46fa29695efed9a3c7e3ba891e8f69ee155e02 (diff)
downloadbw-atari8-tools-14595634df55b698f0b924e75572df6f0b809555.tar.gz
listbas: handle A+ ERROR- token (required bas.c changes); don't segfault on runaway variable name lookup.
Diffstat (limited to 'bas.c')
-rw-r--r--bas.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/bas.c b/bas.c
index 5321070..110e625 100644
--- a/bas.c
+++ b/bas.c
@@ -22,6 +22,11 @@ int verbose = 0;
in sync with the token stream. */
int allow_hex_const = 0;
+/* BASIC/A+ uses the same cmd tokens for REM and DATA that BASIC does,
+ but not for the ERROR- token. Unfortunately bas.c needs to know it's
+ an A+ program so it can handle this token correctly. */
+int aplus_errtok_hack = 0;
+
unsigned short lomem;
unsigned short vntp;
unsigned short vntd;
@@ -376,6 +381,14 @@ void walk_code(unsigned int startlineno, unsigned int endlineno) {
CALL(on_text);
pos = end;
break;
+ case 0x53: /* BASIC/A+'s ERROR- token */
+ if(aplus_errtok_hack) {
+ pos++;
+ CALL(on_text);
+ pos = end;
+ break;
+ }
+ /* fall thru */
default:
pos++;
break;