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 8c93eb6681295087da3611f9ee78f5c9f7a9dd37
parent 7fd7a12d75dd874153443d53bb158a501de067aa
Author: Michael Forney <mforney@mforney.org>
Date:   Fri, 15 Feb 2019 16:38:18 -0800

Use consume in a couple places

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

diff --git a/decl.c b/decl.c @@ -471,9 +471,8 @@ declaratortypes(struct scope *s, struct list *result, char **name, bool allowabs *p = mkparam(tok.lit, NULL); p = &(*p)->next; next(); - if (tok.kind != TCOMMA) + if (!consume(TCOMMA)) break; - next(); } while (tok.kind == TIDENT); break; } @@ -483,12 +482,10 @@ declaratortypes(struct scope *s, struct list *result, char **name, bool allowabs for (;;) { *p = parameter(s); p = &(*p)->next; - if (tok.kind != TCOMMA) + if (!consume(TCOMMA)) break; - next(); - if (tok.kind == TELLIPSIS) { + if (consume(TELLIPSIS)) { t->func.isvararg = true; - next(); break; } }