diff options
Diffstat (limited to 'listamsb.c')
-rw-r--r-- | listamsb.c | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -504,6 +504,15 @@ void write_code(int addr, int lineno, const unsigned char *code) { fputc(0x00, outfile); } +int comment_only_line(const unsigned char *code) { + if(code[0] == TOK_REM) return 1; + if(code[0] == ':') { + if(code[1] == TOK_SQUOTE || code[1] == TOK_BANG) + return 1; + } + return 0; +} + int crunch_line(void) { unsigned char code[MAX_LINE_LEN_HARD + 1], byte; int lineno, ptr, codelen = 0, in_string = 0, in_comment = 0, commentstart = 0; @@ -544,10 +553,9 @@ int crunch_line(void) { /* omit comment-only lines */ if(!keep_rems) { - if(code[0] == TOK_REM) return 0; - if(code[0] == ':') { - if(code[1] == TOK_SQUOTE || code[1] == TOK_BANG) - return 0; + if(comment_only_line(code)) { + verbose(1, "removing comment-only line %d", lineno); + return 0; } } @@ -715,7 +723,7 @@ int decrunch_line(void) { /* NOP */ } else { if(tok == ' ' || is_comment_start(tok)) { - verbose(2, "found space/comment at line %d", lineno); + verbose(1, "found space/comment at line %d", lineno); spacecount++; } if(tok == '"') { |