diff options
author | B. Watson <urchlay@slackware.uk> | 2025-03-05 04:32:10 -0500 |
---|---|---|
committer | B. Watson <urchlay@slackware.uk> | 2025-03-05 04:32:10 -0500 |
commit | 4ffee5591ff4c3df33d495743043b3ee6122b762 (patch) | |
tree | 46ca01bc202baad0727ef3ddc4e6b04675fcf178 | |
parent | 3e3c4895badaa04d6c243c9a282008cfcd7a4170 (diff) | |
download | bw-atari8-tools-4ffee5591ff4c3df33d495743043b3ee6122b762.tar.gz |
listamsb: count spaces outside strings/comments (-vv).
-rw-r--r-- | listamsb.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -90,6 +90,7 @@ int proglen = 0; int linecount = 0; int header_read = 0; int printing = 0; +int spacecount = 0; FILE *infile; FILE *outfile; @@ -180,6 +181,10 @@ void finish(int rv) { } } + verbose(2, "spaces outside strings/comments: %d (%.1f%%)", + spacecount, + (float)(spacecount) / (float)(bytes_read) * 100.0); + verbose(1, "exit status: %d (%s)", rv, (rv ? "ERROR" : "OK")); exit(rv); @@ -413,6 +418,7 @@ int next_line(void) { warn("line %d has character %d outside of a string, maybe Atari BASIC?", lineno, byte); } + if(byte == ' ') spacecount++; list_char(byte); } } |