More order independent globals

This commit is contained in:
Krzosa Karol
2022-05-29 22:07:08 +02:00
parent 2ad3131dba
commit 4434ad1fb5
6 changed files with 39 additions and 11 deletions

View File

@@ -285,7 +285,7 @@ gen_ast(Ast *ast){
else if(sym->type == type_type){
if(sym->type_val->kind == TYPE_STRUCT){
Ast_Struct *agg = const_get_struct(sym->type_val->sym->ast);
if(node->value->kind == AST_STRUCT){
if(agg){
gen("struct %s{", node->name.str);
global_indent++;
For(agg->members){