From e87cd0b8891e6b57c3e96ce7e53f65080ec33daa Mon Sep 17 00:00:00 2001 From: lemon Date: Thu, 11 Sep 2025 16:23:18 +0200 Subject: preprocessor: fix order of expansion wiht macro arguments --- lex.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lex.h') diff --git a/lex.h b/lex.h index 3315d6b..515613f 100644 --- a/lex.h +++ b/lex.h @@ -52,7 +52,8 @@ struct token { short t; /* toktag */ bool litlit; union { - uint len, argidx; + uint len; + struct { ushort macidx, argidx; }; }; struct span span; const char *s; @@ -69,7 +70,8 @@ struct token { * otherwise s is heap allocated buffer of len bytes * for macro arg/stringify: * s is like keyword/ident - * argidx is index in macro param list + * argidx is index in macro param list, + * macidx is macro id of which it is a parameter */ }; -- cgit v1.2.3