aboutsummaryrefslogtreecommitdiff
path: root/src/index
diff options
context:
space:
mode:
authorDanielGavin <danielgavin5@hotmail.com>2020-12-23 16:15:42 +0100
committerDanielGavin <danielgavin5@hotmail.com>2020-12-23 16:15:42 +0100
commite1ba80418102e22d170130d13fafddd84df30de4 (patch)
tree4a14b7c3296d40d2265dd7f9271cbd6fc974df42 /src/index
parent7ecf7b86089b3d6f7d971346b9c36e2df76cc3bc (diff)
start working on using in struct fields
Diffstat (limited to 'src/index')
-rw-r--r--src/index/collector.odin12
-rw-r--r--src/index/symbol.odin1
2 files changed, 12 insertions, 1 deletions
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
};