aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2019-02-15 16:38:18 -0800
committerMichael Forney <mforney@mforney.org>2019-02-15 16:50:24 -0800
commit8c93eb6681295087da3611f9ee78f5c9f7a9dd37 (patch)
tree509ae140ee0967e42a1095d9a0a19610384223ee
parent7fd7a12d75dd874153443d53bb158a501de067aa (diff)
Use consume in a couple places
-rw-r--r--decl.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/decl.c b/decl.c
index a6e4e71..6d6bd84 100644
--- 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;
}
}