aboutsummaryrefslogtreecommitdiffhomepage
path: root/lex.h
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2025-09-11 16:23:18 +0200
committerlemon <lsof@mailbox.org>2025-09-11 16:23:18 +0200
commite87cd0b8891e6b57c3e96ce7e53f65080ec33daa (patch)
treec758819cf8b499d7cf72a7da0a31d0c1b58d3b4e /lex.h
parentbed033d3ac67a9c5d88e061c6070d049bd7527fd (diff)
preprocessor: fix order of expansion wiht macro arguments
Diffstat (limited to 'lex.h')
-rw-r--r--lex.h6
1 files changed, 4 insertions, 2 deletions
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
*/
};