From db1941ff2fe38dea52ad522566c75fc861ddabc1 Mon Sep 17 00:00:00 2001 From: DanielGavin Date: Thu, 2 May 2024 20:57:16 +0200 Subject: Use filepath.abs on ols executable path --- src/common/ast.odin | 2 +- src/server/build.odin | 17 ++++++++++++++--- src/server/collector.odin | 23 +++++++++++------------ 3 files changed, 26 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/common/ast.odin b/src/common/ast.odin index dbe236a..29d3e6c 100644 --- a/src/common/ast.odin +++ b/src/common/ast.odin @@ -924,7 +924,7 @@ node_equal_node :: proc(a, b: ^ast.Node) -> bool { if n, ok := a.derived.(^Bit_Field_Type); ok { if len(n.fields) != len(m.fields) do return false ret := node_equal(n.backing_type, m.backing_type) - for i in 0.. SymbolCollection { - return( - SymbolCollection { - allocator = allocator, - config = config, - packages = make(map[string]SymbolPackage, 16, allocator), - unique_strings = make(map[string]string, 16, allocator), - } \ - ) + return SymbolCollection { + allocator = allocator, + config = config, + packages = make(map[string]SymbolPackage, 16, allocator), + unique_strings = make(map[string]string, 16, allocator), + } } delete_symbol_collection :: proc(collection: SymbolCollection) { @@ -197,8 +195,8 @@ collect_bit_field_fields :: proc( package_map: map[string]string, file: ast.File, ) -> SymbolBitFieldValue { - names := make([dynamic]string, 0, len(fields), collection.allocator) - types := make([dynamic]^ast.Expr, 0, len(fields), collection.allocator) + names := make([dynamic]string, 0, len(fields), collection.allocator) + types := make([dynamic]^ast.Expr, 0, len(fields), collection.allocator) ranges := make([dynamic]common.Range, 0, len(fields), collection.allocator) for field, i in fields { @@ -216,7 +214,7 @@ collect_bit_field_fields :: proc( append(&ranges, common.get_token_range(ident, file.src)) } } - + value := SymbolBitFieldValue { names = names[:], types = types[:], @@ -855,7 +853,8 @@ get_package_mapping :: proc( continue } - if i := strings.index(imp.fullpath, ":"); i != -1 && i != len(imp.fullpath) - 1 { + if i := strings.index(imp.fullpath, ":"); + i != -1 && i != len(imp.fullpath) - 1 { collection := imp.fullpath[1:i] p := imp.fullpath[i + 1:len(imp.fullpath) - 1] -- cgit v1.2.3