Only check files that have been truly imported.

This commit is contained in:
Ginger Bill
2017-02-11 15:50:24 +00:00
parent 73d6a55f5c
commit 346aa5f71c
10 changed files with 286 additions and 201 deletions
+9 -5
View File
@@ -102,12 +102,12 @@ typedef struct TypeRecord {
Entity **fields_in_src_order; // Entity_Variable
i64 custom_align; // NOTE(bill): Only used in structs at the moment
Entity * names;
Type * enum_base_type;
Entity * enum_count;
Entity * enum_min_value;
Entity * enum_max_value;
Entity * enum_names;
} TypeRecord;
#define TYPE_KINDS \
@@ -1318,6 +1318,14 @@ Selection lookup_field_with_selection(gbAllocator a, Type *type_, String field_n
return sel;
}
if (is_type) {
if (type->kind == Type_Record) {
if (type->Record.names != NULL &&
str_eq(field_name, str_lit("names"))) {
sel.entity = type->Record.names;
return sel;
}
}
if (is_type_union(type)) {
// NOTE(bill): The subtype for a union are stored in the fields
// as they are "kind of" like variables but not
@@ -1347,10 +1355,6 @@ Selection lookup_field_with_selection(gbAllocator a, Type *type_, String field_n
sel.entity = type->Record.enum_max_value;
return sel;
}
if (str_eq(field_name, str_lit("names"))) {
sel.entity = type->Record.enum_names;
return sel;
}
}
for (isize i = 0; i < type->Record.field_count; i++) {