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

@@ -1651,6 +1651,27 @@ type_check :: (checker : *Semantic_Checker, root : *AST_Node) {
traverse(checker, root);
}
check :: (result : *Compile_Result) {
if result.had_error {
return;
}
for *file : result.files {
checker : Semantic_Checker;
checker.current_buffer_index = 0;
checker.current_sampler_index = 0;
checker.current_texture_index = 0;
array_reserve(*checker.result.messages, 16);
add_hlsl_builtins(*checker);
type_check(*checker, file.ast_root);
file.semantic_check_result = checker.result;
copy_messages(checker.result.messages, *result.messages);
}
}
check :: (checker : *Semantic_Checker, root : *AST_Node) -> Semantic_Check_Result {
checker.current_buffer_index = 0;
checker.current_sampler_index = 0;