Fix struct function ordering in c files

This commit is contained in:
Krzosa Karol
2022-06-17 11:46:05 +02:00
parent 218ca7266a
commit a77f0ee8fe
4 changed files with 47 additions and 49 deletions

View File

@@ -771,11 +771,6 @@ typedef struct String{
if(it->kind == AST_STRUCT){
genln("typedef struct %Q %Q;", it->name, it->name);
}
else if(it->kind == AST_LAMBDA){
genln("");
gen_lambda(it->name, it->lambda, false);
}
}
Scratch scratch;
@@ -808,9 +803,17 @@ typedef struct String{
global_indent--;
genln("} Tuple%llu;", type->type_id);
}
}
For(pctx->ordered_decls){
if(it->kind == AST_LAMBDA){
genln("");
gen_lambda(it->name, it->lambda, false);
}
}
For(pctx->ordered_decls){
genln("");
gen_ast(it);