aboutsummaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/pp.c b/pp.c
index e62845f..4831cd6 100644
--- a/pp.c
+++ b/pp.c
@@ -133,14 +133,9 @@ peek(int kind)
char *
expect(enum tokenkind kind, const char *msg)
{
- char *lit, want[64], got[64];
+ char *lit;
- if (tok.kind != kind) {
- tokendesc(want, sizeof(want), kind, NULL);
- tokendesc(got, sizeof(got), tok.kind, tok.lit);
- error(&tok.loc, "expected %s %s, saw %s", want, msg, got);
- }
- lit = tok.lit;
+ lit = tokencheck(&tok, kind, msg);
next();
return lit;