Compiling global, work on AST_LAMBDA_EXPR
This commit is contained in:
5
ast.cpp
5
ast.cpp
@@ -152,7 +152,7 @@ struct Ast_Lambda : Ast_Expr {
|
||||
Array<Ast_Decl *> args;
|
||||
Ast_Expr *ret;
|
||||
Ast_Scope *scope;
|
||||
B32 has_var_args;
|
||||
Ast_Resolved_Type *type;
|
||||
};
|
||||
|
||||
struct Ast_Array: Ast_Expr{
|
||||
@@ -327,13 +327,12 @@ ast_expr_index(Token *pos, Ast_Expr *expr, Ast_Expr *index){
|
||||
}
|
||||
|
||||
function Ast_Lambda *
|
||||
ast_lambda(Token *pos, Array<Ast_Decl *> params, B32 has_var_args, Ast_Expr *ret, Ast_Scope *scope){
|
||||
ast_lambda(Token *pos, Array<Ast_Decl *> params, Ast_Expr *ret, Ast_Scope *scope){
|
||||
AST_NEW(Lambda, LAMBDA_EXPR, pos, AST_EXPR);
|
||||
result->flags = AST_EXPR;
|
||||
result->args = params.tight_copy(pctx->perm);
|
||||
result->scope = scope;
|
||||
result->ret = ret;
|
||||
result->has_var_args = has_var_args;
|
||||
if(!ret) result->ret = ast_ident(result->pos, intern_void);
|
||||
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user