More work on calls and compound statements
This commit is contained in:
15
new_ast.cpp
15
new_ast.cpp
@@ -213,17 +213,17 @@ struct Ast_Array: Ast_Expr{
|
||||
Ast_Expr *expr;
|
||||
};
|
||||
|
||||
struct Ast_Named:Ast{
|
||||
Intern_String name;
|
||||
};
|
||||
|
||||
struct Ast_Resolved_Type;
|
||||
struct Ast_Struct: Ast_Expr{
|
||||
// Required to be Ast_Struct or Ast_Var or Ast_Const
|
||||
Array<Ast *> members;
|
||||
Array<Ast_Named *> members;
|
||||
Ast_Resolved_Type *type;
|
||||
};
|
||||
|
||||
struct Ast_Named:Ast{
|
||||
Intern_String name;
|
||||
};
|
||||
|
||||
struct Ast_Var: Ast_Named{
|
||||
Ast_Expr *typespec;
|
||||
Ast_Expr *expr;
|
||||
@@ -426,11 +426,12 @@ ast_array(Token *pos, Ast_Expr *expr){
|
||||
}
|
||||
|
||||
function Ast_Struct *
|
||||
ast_struct(Token *pos, Array<Ast *> members){
|
||||
ast_struct(Token *pos, Array<Ast_Named *> members){
|
||||
AST_NEW(Struct, STRUCT, pos, AST_AGGREGATE);
|
||||
result->members = members.tight_copy(pctx->perm);
|
||||
For(result->members) {
|
||||
assert(it[0]->kind == AST_VAR || it[0]->kind == AST_CONST || it[0]->kind == AST_STRUCT);
|
||||
assert(is_flag_set(it[0]->flags, AST_BINDING));
|
||||
assert(it[0]->kind == AST_VAR || it[0]->kind == AST_CONST);
|
||||
it[0]->parent = result;
|
||||
}
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user