aboutsummaryrefslogtreecommitdiff
path: root/bootstrap/parse.c
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2022-08-06 07:07:26 +0200
committerlemon <lsof@mailbox.org>2022-08-06 07:07:26 +0200
commit1dd19e56fb81d1334bb21e4aa097f9593576feb7 (patch)
treee3e986837c05c3cd0d7f86a3fec6a7798568580c /bootstrap/parse.c
parent6c0dc2b1171b22a93e61f50fa46852a70e129e50 (diff)
print source on error
Diffstat (limited to 'bootstrap/parse.c')
-rw-r--r--bootstrap/parse.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bootstrap/parse.c b/bootstrap/parse.c
index 4372cdc..381cfcc 100644
--- a/bootstrap/parse.c
+++ b/bootstrap/parse.c
@@ -544,7 +544,7 @@ parsefntype(struct parser *P) {
ty.fn.variadic = 1;
} else {
const struct type *param;
- lexexpects(P, TKident, "parameter name");
+ tok = lexexpects(P, TKident, "parameter name");
param = parsetype(P);
if (!completetype(param))
fatal(P, tok.span, "parameter type is incomplete (%t)",
@@ -1863,7 +1863,7 @@ parsefn(struct decl *decl, struct parser *P) {
if (lexmatch(P, &tok, '...')) {
fn->variadic = 1;
} else {
- param.name = lexexpects(P, TKident, "parameter name").str;
+ param.name = (tok = lexexpects(P, TKident, "parameter name")).str;
param.ty = parsetype(P);
if (!completetype(param.ty))
fatal(P, tok.span, "parameter type is incomplete (%t)",