From 8d06f3e1b9b5ca794670ee1b75ae7f21a07bdfbe Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Thu, 28 Mar 2024 12:04:25 -0700 Subject: [PATCH] (uxnasm) Fixed issue with comments inside macros --- etc/hello.tal | 2 +- src/uxnasm.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/etc/hello.tal b/etc/hello.tal index ea2c00f..67533a2 100644 --- a/etc/hello.tal +++ b/etc/hello.tal @@ -2,7 +2,7 @@ |00 @System &vector $2 &expansion $2 &wst $1 &rst $1 &metadata $2 &r $2 &g $2 &b $2 &debug $1 &state $1 -%emit ( byte -- ) { #18 DEO } +%emit ( byte -- ) { ( hey ) #18 DEO } |0100 @program diff --git a/src/uxnasm.c b/src/uxnasm.c index aa7d0e2..ce53375 100644 --- a/src/uxnasm.c +++ b/src/uxnasm.c @@ -188,8 +188,10 @@ makemacro(char *name, FILE *f, Context *ctx) while(f && fread(&c, 1, 1, f) && c != '}') { if(c == 0xa) ctx->line += 1; if(c == '%') return 0; - if(c == '(') walkcomment(f, ctx); - *dictnext++ = c; + if(c == '(') + walkcomment(f, ctx); + else + *dictnext++ = c; } *dictnext++ = 0; return 1;