From 4ffee5591ff4c3df33d495743043b3ee6122b762 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Wed, 5 Mar 2025 04:32:10 -0500 Subject: listamsb: count spaces outside strings/comments (-vv). --- listamsb.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/listamsb.c b/listamsb.c index 88c465a..ed2f813 100644 --- a/listamsb.c +++ b/listamsb.c @@ -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); } } -- cgit v1.2.3