aboutsummaryrefslogtreecommitdiffhomepage
path: root/io.c
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2025-09-10 20:15:56 +0200
committerlemon <lsof@mailbox.org>2025-09-10 22:41:39 +0200
commit5bcdee9f0702e4f54897166250898475f0d26ca3 (patch)
treeabc9087456157ab2b182b25a3ab65c3dfcf4433b /io.c
parent3fc3b2680581a59b3d08244a190d5d7bdcf80e45 (diff)
lex: stringify args in function macros
Diffstat (limited to 'io.c')
-rw-r--r--io.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/io.c b/io.c
index 9b1720b..c8e338f 100644
--- a/io.c
+++ b/io.c
@@ -475,9 +475,16 @@ vbfmt(struct wbuf *out, const char *fmt, va_list ap)
case TKSTRLIT:
n += bfmt(buf, "%'S", tok->s, tok->len);
break;
- case TKIDENT:
+ case TKPPMACSTR:
+ if (quote) n += bputc(buf, '`');
+ n += bfmt(buf, "#%s", tok->s);
+ if (quote) n += bputc(buf, '\'');
+ break;
case TKPPMACARG:
- n += bfmt(buf, "`%s'", tok->s);
+ case TKIDENT:
+ if (quote) n += bputc(buf, '`');
+ n += bfmt(buf, "%s", tok->s);
+ if (quote) n += bputc(buf, '\'');
break;
case TKEOF:
n += bwriteS(buf, "<end-of-file>");