Constants in structs

This commit is contained in:
Krzosa Karol
2022-05-30 13:44:10 +02:00
parent 55fd4ca40c
commit 0e0b95ab52
6 changed files with 17 additions and 11 deletions

View File

@@ -136,6 +136,7 @@ gen_expr(Ast_Expr *ast){
}
CASE(CALL, Call){
// @todo: Reach into map instead of direct lookup
if(node->type->kind == TYPE_STRUCT){ // @todo: Should this be type_type maybe???
gen("(");
gen_simple_decl(node->type, {});
@@ -145,9 +146,9 @@ gen_expr(Ast_Expr *ast){
For(node->exprs){
auto comp = it;
if(comp->name){
gen("[");
gen(".");
gen_expr(comp->name);
gen("] = ");
gen(" = ");
}
if(comp->index){
gen("[");