aboutsummaryrefslogtreecommitdiffhomepage
path: root/io.c
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2023-05-26 09:20:58 +0200
committerlemon <lsof@mailbox.org>2023-05-26 09:20:58 +0200
commit640a3dac2b18d037169af15dfd5502c386c7e828 (patch)
tree79e7ee3fa81e73855ce1bc78d7c4bf1ad3ac8f0d /io.c
parent9100ed2b5dd01df8e6b766c7bc2a12c0dd44f1ff (diff)
hm
Diffstat (limited to 'io.c')
-rw-r--r--io.c33
1 files changed, 26 insertions, 7 deletions
diff --git a/io.c b/io.c
index 83b15b8..548e5ae 100644
--- a/io.c
+++ b/io.c
@@ -185,6 +185,7 @@ pritypebefore(struct wbuf *buf, union type ty, int qual)
case TYFLOAT: s = "float"; goto Prim;
case TYDOUBLE: s = "double"; goto Prim;
case TYLDOUBLE:s = "long double"; goto Prim;
+ case TYVALIST: s = "va_list"; goto Prim;
case TYPTR:
chld = typechild(ty);
n = pritypebefore(buf, chld, ty.flag & TFCHLDQUAL);
@@ -432,7 +433,7 @@ vbfmt(struct wbuf *out, const char *fmt, va_list ap)
Tok:
switch (tok->t) {
case TKXXX:
- n += bwriteS(buf, "???");
+ n += bwriteS(buf, "\?\?\?");
break;
case TKNUMLIT:
s = (const char *)(getfile(tok->span.sl.file)->p + tok->span.sl.off);
@@ -450,19 +451,37 @@ vbfmt(struct wbuf *out, const char *fmt, va_list ap)
case TKEOF:
n += bwriteS(buf, "<end-of-file>");
break;
+ case TKEQU: s = "=="; C2: iowrite(buf, s, 2); n += 2; break;
+ case TKNEQ: s = "!="; goto C2;
+ case TKLTE: s = "<="; goto C2;
+ case TKGTE: s = ">="; goto C2;
+ case TKSHR: s = ">>"; goto C2;
+ case TKSHL: s = "<<"; goto C2;
+ case TKINC: s = "++"; goto C2;
+ case TKDEC: s = "--"; goto C2;
+ case TKDOTS: n += bwriteS(buf, "..."); break;
+ case TKARROW: s = "->"; goto C2;
+ case TKPPCAT: s = "##"; goto C2;
+ case TKLOGAND: s = "&&"; goto C2;
+ case TKLOGIOR: s = "||"; goto C2;
+ case TKSETADD: s = "+="; goto C2;
+ case TKSETSUB: s = "-="; goto C2;
+ case TKSETMUL: s = "*="; goto C2;
+ case TKSETDIV: s = "/="; goto C2;
+ case TKSETMOD: s = "%="; goto C2;
+ case TKSETIOR: s = "|="; goto C2;
+ case TKSETXOR: s = "^="; goto C2;
+ case TKSETAND: s = "&="; goto C2;
+ case TKSETSHR: n += bwriteS(buf, ">>="); break;
+ case TKSETSHL: n += bwriteS(buf, "<<="); break;
default:
if (quote) n += bputc(buf, '`');
if (in_range(tok->t, TKWBEGIN_, TKWEND_)) {
n += bfmt(buf, "%s", tok->ident);
} else if (aisprint(tok->t)) {
n += bputc(buf, tok->t);
- } else if (tok->t >> 16) {
- n += bputc(buf, tok->t >> 0);
- n += bputc(buf, tok->t >> 8);
- n += bputc(buf, tok->t >> 16);
} else {
- n += bputc(buf, tok->t >> 0);
- n += bputc(buf, tok->t >> 8);
+ n += bwriteS(buf, "??");
}
if (quote) n += bputc(buf, '\'');
break;