Constants in structs
This commit is contained in:
@@ -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("[");
|
||||
|
||||
Reference in New Issue
Block a user