aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2019-05-12 13:24:39 -0700
committerMichael Forney <mforney@mforney.org>2019-05-12 15:40:50 -0700
commitf7b471b8576846e575f8c73ef6b70c4b06ff377d (patch)
tree52ad70b91acc0ca10257c9cefa79f6e0f53e0883
parent49be4196734f3bc6603022b18bbce5404397ddb3 (diff)
Improve error message and simplify slightly
-rw-r--r--decl.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/decl.c b/decl.c
index b771a04..a65d7c6 100644
--- a/decl.c
+++ b/decl.c
@@ -951,17 +951,10 @@ decl(struct scope *s, struct func *f)
}
break;
}
- switch (tok.kind) {
- case TCOMMA:
- next();
- allowfunc = 0;
- break;
- case TSEMICOLON:
- next();
+ if (consume(TSEMICOLON))
return true;
- default:
- error(&tok.loc, "expected ',' or ';' after declarator");
- }
+ expect(TCOMMA, "or ';' after declarator");
+ allowfunc = 0;
}
}