Simplification of API.

This commit is contained in:
2025-01-04 23:12:54 +01:00
parent 7787d1307b
commit d08529a3eb
5 changed files with 52 additions and 5 deletions

View File

@@ -504,6 +504,22 @@ emit_declaration :: (state : *Codegen_State, node : *AST_Node) {
}
}
codegen :: (result : *Compile_Result) {
if result.had_error {
return;
}
for *file : result.files {
state : Codegen_State;
init_codegen_state(*state, file.ast_root, file.semantic_check_result, .HLSL);
//@Incomplete(nb): just call the codegen function for now with old result struct
codegen_result := codegen(*state);
file.codegen_result_text = copy_string(codegen_result.result_text);
}
}
codegen :: (state : *Codegen_State) -> Codegen_Result {
found_function : bool = false;
// found_struct : bool = false;