aboutsummaryrefslogtreecommitdiff
path: root/src/checker/entity.cpp
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2016-09-14 19:35:13 +0100
committerGinger Bill <bill@gingerbill.org>2016-09-14 19:35:13 +0100
commit79f575ae8e7dda58a842dda3690b691e942ea86e (patch)
treeae339da6303711c3dad8815ef3ba0ea18ae31e2f /src/checker/entity.cpp
parentbb109b47d6b43547481a695ed9401aca95cbdf0e (diff)
#import "" as namespace
Diffstat (limited to 'src/checker/entity.cpp')
-rw-r--r--src/checker/entity.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/checker/entity.cpp b/src/checker/entity.cpp
index 85e668c0d..3814f38f0 100644
--- a/src/checker/entity.cpp
+++ b/src/checker/entity.cpp
@@ -9,6 +9,7 @@ enum BuiltinProcId;
ENTITY_KIND(TypeName), \
ENTITY_KIND(Procedure), \
ENTITY_KIND(Builtin), \
+ ENTITY_KIND(ImportName), \
ENTITY_KIND(Count),
@@ -49,11 +50,19 @@ struct Entity {
i32 field_index; // Order in source
b8 is_field; // Is struct field
} Variable;
- struct {} TypeName;
+ struct {
+ struct DeclInfo *decl; // Usually NULL
+ } TypeName;
struct {
b8 pure;
} Procedure;
struct { BuiltinProcId id; } Builtin;
+ struct {
+ String path;
+ String name;
+ Scope *scope;
+ b32 used;
+ } ImportName;
};
};
@@ -124,6 +133,15 @@ Entity *make_entity_builtin(gbAllocator a, Scope *scope, Token token, Type *type
return entity;
}
+Entity *make_entity_import_name(gbAllocator a, Scope *scope, Token token, Type *type,
+ String path, String name, Scope *import_scope) {
+ Entity *entity = alloc_entity(a, Entity_ImportName, scope, token, type);
+ entity->ImportName.path = path;
+ entity->ImportName.name = name;
+ entity->ImportName.scope = import_scope;
+ return entity;
+}
+
Entity *make_entity_dummy_variable(gbAllocator a, Scope *file_scope, Token token) {
token.string = make_string("_");
return make_entity_variable(a, file_scope, token, NULL);