0
0
Fork 0
mirror of https://git.sr.ht/~rabbits/uxn synced 2024-11-24 23:05:12 +00:00

(uxnasm) Fixed issue with comments inside macros

This commit is contained in:
Devine Lu Linvega 2024-03-28 12:04:25 -07:00
parent 6c3888f306
commit 8d06f3e1b9
2 changed files with 5 additions and 3 deletions

View file

@ -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

View file

@ -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;