diff options
author | Michael Forney <mforney@mforney.org> | 2019-05-12 13:24:39 -0700 |
---|---|---|
committer | Michael Forney <mforney@mforney.org> | 2019-05-12 15:40:50 -0700 |
commit | f7b471b8576846e575f8c73ef6b70c4b06ff377d (patch) | |
tree | 52ad70b91acc0ca10257c9cefa79f6e0f53e0883 | |
parent | 49be4196734f3bc6603022b18bbce5404397ddb3 (diff) |
Improve error message and simplify slightly
-rw-r--r-- | decl.c | 13 |
1 files changed, 3 insertions, 10 deletions
@@ -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; } } |