summaryrefslogtreecommitdiff
path: root/parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/parse.c b/parse.c
index 3e5b363..2527b0f 100644
--- a/parse.c
+++ b/parse.c
@@ -608,12 +608,18 @@ static bool parse_type(Parser *p, Type *type) {
/* help cgen out */
struc->c.id = 0;
struc->fields = NULL;
+ struc->params = NULL;
struc->where = parser_mk_loc(p);
struc->where.start = t->token;
++t->token;
+ if (token_is_kw(t->token, KW_LPAREN)) {
+ ++t->token;
+ if (!parse_decl_list(p, &struc->params, DECL_END_RPAREN_COMMA))
+ return false;
+ }
if (!token_is_kw(t->token, KW_LBRACE)) {
- tokr_err(t, "Expected { or ( to follow struct.");
+ tokr_err(t, "Expected { to follow struct.");
return false;
}
++t->token;