diff options
Diffstat (limited to 'bootstrap/parse.c')
| -rw-r--r-- | bootstrap/parse.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/bootstrap/parse.c b/bootstrap/parse.c index d0bea8e..7c31ce1 100644 --- a/bootstrap/parse.c +++ b/bootstrap/parse.c @@ -1416,7 +1416,32 @@ pexpostfix(struct parser *P) { if (lexpeek(P).t != '(') lexexpect(P, '('); + } else if (ex.ty->t == TYvalist) { + if (!strcmp(fnam, "start")) { + lexexpect(P, '('); + struct expr ex2 = parseexpr(P); + lexexpect(P, ')'); + ex = (struct expr) { + Evastart, ex.span, ty_void, + .binop.lhs = exprdup(ex), + .binop.rhs = exprdup(ex2) + }; + } else if (!strcmp(fnam, "arg")) { + lexexpect(P, '('); + ty = parsetype(P); + lexexpect(P, ')'); + ex = (struct expr) { + Evaarg, ex.span, ty, .child = exprdup(ex) + }; + } else if (!strcmp(fnam, "end")) { + lexexpect(P, '('); + lexexpect(P, ')'); + ex = (struct expr) { + Evaend, ex.span, ty_void, .child = exprdup(ex) + }; + } else goto badmet; } else { + badmet: fatal(P, tok.span, "cannot call `->%s': left-hand-side is not an aggregate (%t)", fnam, ex.ty); } |