From 7828c119e5af8a5739ff28ac67f9decc71982c28 Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Fri, 29 Dec 2023 07:36:19 +0100 Subject: [PATCH] Ensuring that comments still appear in listing --- src/ulas.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ulas.c b/src/ulas.c index 26b3268..8f03ed9 100644 --- a/src/ulas.c +++ b/src/ulas.c @@ -708,6 +708,7 @@ char *ulas_preprocexpand(struct ulas_preproc *pp, const char *raw_line, int read = 0; int first_tok = 1; int skip_next_tok = 0; + int comment_seen = 0; // go through all tokens, see if a define matches the token, // if so expand it @@ -727,11 +728,11 @@ char *ulas_preprocexpand(struct ulas_preproc *pp, const char *raw_line, } else if (pp->tok.buf[0] == ULAS_TOK_COMMENT) { // if its a comment at the end of a preproc statement // just bail now - break; + comment_seen = 1; } first_tok = 0; - if (def) { + if (def && !comment_seen) { // if so... expand now and leave switch (def->type) { case ULAS_PPDEF: { -- 2.30.2