add new and init to toolchain

This commit is contained in:
2026-07-04 17:38:45 +02:00
parent cdde49e68b
commit e7f69ffb5a
17 changed files with 711 additions and 63 deletions
+4 -2
View File
@@ -1416,11 +1416,13 @@ load :: proc(
allocator := context.allocator,
c_options := cimport.Options{},
selected := target.DEFAULT,
project_root_path := "",
) -> (ast.Module, bool) {
module := ast.init_module(allocator)
project_root, project_root_ok := filepath.abs(".", allocator)
project_root_source := project_root_path if len(project_root_path) > 0 else root_path
project_root, project_root_ok := filepath.abs(project_root_source, allocator)
if !project_root_ok {
project_root = strings.clone(".", allocator)
project_root = strings.clone(project_root_source, allocator)
}
state := State{
module=&module,