Core: Remove AST_Tuple, repurpose VAR_UNPACK (buggy probably)
This commit is contained in:
@@ -284,13 +284,8 @@ parse_stmt_scope(Ast_Scope *scope_defined_outside = 0) {
|
||||
Token *token = token_get();
|
||||
|
||||
if (token_match_keyword(pctx->keyword_return)) {
|
||||
Array<Ast_Expr *> expr = {scratch.arena};
|
||||
if (!token_is_scope()) {
|
||||
do {
|
||||
Ast_Expr *subexpr = parse_expr();
|
||||
expr.add(subexpr);
|
||||
} while (token_match(TK_Comma));
|
||||
}
|
||||
Ast_Expr *expr = 0;
|
||||
if (!token_is_scope()) expr = parse_expr();
|
||||
scope->stmts.add(ast_return(token, expr));
|
||||
}
|
||||
|
||||
@@ -518,17 +513,7 @@ parse_lambda(Token *token) {
|
||||
Scoped_Arena scratch(pctx->scratch);
|
||||
|
||||
Array<Ast_Decl *> params = parse_parameter_list(scratch.arena);
|
||||
Array<Ast_Expr *> ret = {scratch.arena};
|
||||
if (token_match(TK_Colon)) {
|
||||
do {
|
||||
Ast_Expr *typespec = parse_expr();
|
||||
set_flag_typespec(typespec);
|
||||
|
||||
ret.add(typespec);
|
||||
} while (token_match(TK_Comma));
|
||||
}
|
||||
else ret.add(ast_ident(token, pctx->intern_void));
|
||||
|
||||
Ast_Expr *ret = parse_optional_type();
|
||||
Ast_Scope *scope = token_is(OPEN_SCOPE) ? parse_stmt_scope() : 0;
|
||||
Ast_Lambda *result = ast_lambda(token, params, ret, scope);
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user