add ArrayList alias to std

This commit is contained in:
2026-07-13 13:46:45 +02:00
parent 288df082e2
commit 6455df52b4
14 changed files with 600 additions and 13 deletions
+25 -1
View File
@@ -868,6 +868,11 @@ build_symbol_indexes :: proc(checker: ^Checker) {
function_count += 1
}
}
for alias in checker.ast_module.aliases {
if alias.valid && alias.kind == .Function {
function_count += 1
}
}
checker.function_index = make([]Function_Index_Entry, function_count, checker.allocator)
function_index := 0
for function, id in checker.ast_module.functions {
@@ -877,12 +882,31 @@ build_symbol_indexes :: proc(checker: ^Checker) {
checker.function_index[function_index] = Function_Index_Entry{scope=function.pkg, file=function.file, hidden=function.file_hidden, name=function.name, id=ast.function_id(id)}
function_index += 1
}
for alias in checker.ast_module.aliases {
if alias.valid && alias.kind == .Function {
checker.function_index[function_index] = Function_Index_Entry{scope=alias.pkg, file=alias.file, hidden=alias.file_hidden, name=alias.name, id=ast.Function_Id(alias.target)}
function_index += 1
}
}
slice.sort_by(checker.function_index, function_index_less)
checker.global_index = make([]Global_Index_Entry, len(checker.ast_module.globals), checker.allocator)
global_count := len(checker.ast_module.globals)
for alias in checker.ast_module.aliases {
if alias.valid && alias.kind == .Global {
global_count += 1
}
}
checker.global_index = make([]Global_Index_Entry, global_count, checker.allocator)
for global, id in checker.ast_module.globals {
checker.global_index[id] = Global_Index_Entry{scope=global.pkg, file=global.file, hidden=global.file_hidden, name=global.name, id=ast.global_id(id)}
}
global_index := len(checker.ast_module.globals)
for alias in checker.ast_module.aliases {
if alias.valid && alias.kind == .Global {
checker.global_index[global_index] = Global_Index_Entry{scope=alias.pkg, file=alias.file, hidden=alias.file_hidden, name=alias.name, id=ast.Global_Id(alias.target)}
global_index += 1
}
}
slice.sort_by(checker.global_index, global_index_less)
checker.import_index = make([]Import_Index_Entry, len(checker.ast_module.imports), checker.allocator)