From e1ba80418102e22d170130d13fafddd84df30de4 Mon Sep 17 00:00:00 2001 From: DanielGavin Date: Wed, 23 Dec 2020 16:15:42 +0100 Subject: start working on using in struct fields --- src/index/collector.odin | 12 +++++++++++- src/index/symbol.odin | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'src/index') diff --git a/src/index/collector.odin b/src/index/collector.odin index 30150a7..4154637 100644 --- a/src/index/collector.odin +++ b/src/index/collector.odin @@ -92,6 +92,7 @@ collect_struct_fields :: proc(collection: ^SymbolCollection, struct_type: ast.St names := make([dynamic] string, 0, collection.allocator); types := make([dynamic] ^ast.Expr, 0, collection.allocator); + usings := make([dynamic] bool, 0, collection.allocator); for field in struct_type.fields.list { @@ -102,14 +103,23 @@ collect_struct_fields :: proc(collection: ^SymbolCollection, struct_type: ast.St cloned := clone_type(field.type, collection.allocator, &collection.unique_strings); replace_package_alias(cloned, package_map, collection); append(&types, cloned); + + if .Using in field.flags { + append(&usings, true); + } + + else { + append(&usings, false); + } + } } - value := SymbolStructValue { names = names[:], types = types[:], + usings = usings[:], }; return value; diff --git a/src/index/symbol.odin b/src/index/symbol.odin index 2950bb9..1f902db 100644 --- a/src/index/symbol.odin +++ b/src/index/symbol.odin @@ -20,6 +20,7 @@ import "shared:common" SymbolStructValue :: struct { names: [] string, types: [] ^ast.Expr, + usings: [] bool, //not memory efficient }; -- cgit v1.2.3