From b16c390dd50c5aaee655cfb18d4c43ed36b9c3d3 Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Mon, 20 Nov 2023 21:41:35 +0100 Subject: [PATCH] Moved comment check to empty line check --- src/ulas.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/ulas.c b/src/ulas.c index b57f15d..1a482f0 100644 --- a/src/ulas.c +++ b/src/ulas.c @@ -1365,10 +1365,6 @@ int ulas_asminstr(char *dst, unsigned long max, const char *line, return -1; } - if (ulas_istokend(&ulas.tok)) { - return 0; - } - if (ulas_tok(&ulas.tok, &line, n) == -1) { ULASERR("Expected label or instruction\n"); return -1; @@ -1442,8 +1438,8 @@ int ulas_asmline(FILE *dst, FILE *src, const char *line, unsigned long n) { // read the first token and decide ulas_tok(&ulas.tok, &line, n); - // we ignore empty lines - if (ulas.tok.buf[0] == '\0') { + // we ignore empty lines or all comments lines + if (ulas_istokend(&ulas.tok)) { ulas_asmlst(start, outbuf, towrite); return 0; } -- 2.30.2