Add var args for using printf
This commit is contained in:
@@ -126,7 +126,7 @@ struct Ast_If: Ast{
|
||||
Array<Ast_If_Node *> ifs;
|
||||
};
|
||||
|
||||
struct Ast_Pass: Ast{}; // @todo
|
||||
struct Ast_Pass: Ast{};
|
||||
|
||||
struct Ast_For: Ast{
|
||||
Ast_Expr *init;
|
||||
@@ -145,6 +145,7 @@ struct Ast_Lambda : Ast_Expr {
|
||||
Array<Ast_Lambda_Arg *> args;
|
||||
Ast_Expr *ret;
|
||||
Ast_Block *block;
|
||||
B32 has_var_args;
|
||||
};
|
||||
|
||||
struct Ast_Array: Ast_Expr{
|
||||
@@ -315,12 +316,13 @@ ast_expr_index(Token *pos, Ast_Expr *expr, Ast_Expr *index){
|
||||
}
|
||||
|
||||
function Ast_Lambda *
|
||||
ast_lambda(Token *pos, Array<Ast_Lambda_Arg *> params, Ast_Expr *ret, Ast_Block *block){
|
||||
ast_lambda(Token *pos, Array<Ast_Lambda_Arg *> params, B32 has_var_args, Ast_Expr *ret, Ast_Block *block){
|
||||
AST_NEW(Lambda, LAMBDA, pos, AST_EXPR);
|
||||
result->flags = AST_EXPR;
|
||||
result->args = params.tight_copy(pctx->perm);
|
||||
result->block = block;
|
||||
result->ret = ret;
|
||||
result->has_var_args = has_var_args;
|
||||
if(!ret) result->ret = ast_ident(result->pos, intern_void);
|
||||
|
||||
if(result->block) result->block->parent = result;
|
||||
|
||||
Reference in New Issue
Block a user