Revert "More work towards the new API"

This reverts commit af3e298b29.
This commit is contained in:
2025-08-13 22:26:43 +02:00
parent af3e298b29
commit 5ec2186a42
5 changed files with 12 additions and 75 deletions

View File

@@ -38,13 +38,9 @@ Codegen_Result :: struct {
}
init_codegen_state :: (state : *Codegen_State, root : *AST_Node, checker_result : Semantic_Check_Result, output_language : Output_Language) {
init_codegen_state(state, root, checker_result.scope_stack, checker_result.type_variables, output_language);
}
init_codegen_state :: (state : *Codegen_State, root : *AST_Node, scope_stack : Scope_Stack, type_vars : [..]Type_Variable, output_language : Output_Language) {
state.root = root;
state.scope_stack = scope_stack;
state.type_variables = type_vars;
state.scope_stack = checker_result.scope_stack;
state.type_variables = checker_result.type_variables;
state.current_scope = cast(Scope_Handle)1;
state.output_language = output_language;
init_string_builder(*state.builder);
@@ -508,21 +504,6 @@ emit_declaration :: (state : *Codegen_State, node : *AST_Node) {
}
}
codegen :: (result : *Compile_Result) {
for *file : result.files {
state : Codegen_State;
init_codegen_state(*state, file.ast_root, file.scope_stack, file.type_variables, .HLSL);
codegen(*state);
file.output_text = state.result.result_text; // need to copy at some point. This whole thing is messy...
copy_messages(state.result.messages, *result.messages);
print("OUTPUT: \n\n%\n\n", file.output_text);
}
}
codegen :: (state : *Codegen_State) -> Codegen_Result {
found_function : bool = false;
// found_struct : bool = false;