cproc

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.nihaljere.xyz/cproc
Log | Files | Refs | Submodules | README | LICENSE

commit f7b471b8576846e575f8c73ef6b70c4b06ff377d
parent 49be4196734f3bc6603022b18bbce5404397ddb3
Author: Michael Forney <mforney@mforney.org>
Date:   Sun, 12 May 2019 13:24:39 -0700

Improve error message and simplify slightly

Diffstat:
Mdecl.c | 13+++----------
1 file changed, 3 insertions(+), 10 deletions(-)

diff --git 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; } }