remove var args from the language

closes #208
This commit is contained in:
Andrew Kelley
2019-12-09 14:55:51 -05:00
parent f205d23e65
commit a3f6a58c77
21 changed files with 2049 additions and 2820 deletions

View File

@@ -802,12 +802,6 @@ static AstNode *ast_parse_fn_proto(ParseContext *pc) {
res->data.fn_proto.auto_err_set = exmark != nullptr;
res->data.fn_proto.return_type = return_type;
// It seems that the Zig compiler expects varargs to be the
// last parameter in the decl list. This is not encoded in
// the grammar, which allows varargs anywhere in the decl.
// Since varargs is gonna be removed at some point, I'm not
// gonna encode this "varargs is always last" rule in the
// grammar, and just enforce it here, until varargs is removed.
for (size_t i = 0; i < params.length; i++) {
AstNode *param_decl = params.at(i);
assert(param_decl->type == NodeTypeParamDecl);