summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXANTRONIX Development2023-09-13 00:56:39 -0400
committerXANTRONIX Development2023-09-13 00:56:39 -0400
commit4451e2f2ef709ad4ad0e519a0310cc1e31c0d25a (patch)
tree5f65a56c50d04597f34df737b39df2fec2835b3b
parentbff09eb8bb9d807ca6923ab47196e38978053df6 (diff)
downloadzxdump-4451e2f2ef709ad4ad0e519a0310cc1e31c0d25a.tar.gz
zxdump-4451e2f2ef709ad4ad0e519a0310cc1e31c0d25a.tar.bz2
zxdump-4451e2f2ef709ad4ad0e519a0310cc1e31c0d25a.zip
Gosh that's awfully convincing
-rw-r--r--main.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/main.c b/main.c
index 1eed7e2..488d230 100644
--- a/main.c
+++ b/main.c
@@ -264,6 +264,8 @@ static inline enum zx_basic_token_type zx_basic_token_type_get(uint8_t b) {
if ((codepoint >= 'A' && codepoint <= 'Z')
|| (codepoint >= '0' && codepoint <= '9')) {
return ZX_BASIC_TOKEN_ALNUM;
+ } else if (codepoint == '"') {
+ return ZX_BASIC_TOKEN_QUOTE;
} else {
return ZX_BASIC_TOKEN_SYMBOL;
}
@@ -319,7 +321,7 @@ static ssize_t zx_dump_basic(int fd) {
break;
}
- if (printf("%d", (int)be16toh(line.num)) < 0) {
+ if (printf("%d ", (int)be16toh(line.num)) < 0) {
goto error_io;
}
@@ -339,10 +341,16 @@ static ssize_t zx_dump_basic(int fd) {
if (type_last == ZX_BASIC_TOKEN_WORD) {
space = 1;
}
+ } else if (type == ZX_BASIC_TOKEN_QUOTE) {
+ if (type_last == ZX_BASIC_TOKEN_WORD) {
+ space = 1;
+ }
} else if (type == ZX_BASIC_TOKEN_SYMBOL) {
space = 0;
} else if (type == ZX_BASIC_TOKEN_WORD) {
- space = 1;
+ if (type_last != ZX_BASIC_TOKEN_SYMBOL) {
+ space = 1;
+ }
} else if (ZX_CHAR_TOKEN_INTEGRAL(c) || ZX_CHAR_TOKEN_FLOAT(c)) {
i += 5;
}