diff options
Diffstat (limited to 'src/entity.cpp')
| -rw-r--r-- | src/entity.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/entity.cpp b/src/entity.cpp index e38a374fc..1f2478c25 100644 --- a/src/entity.cpp +++ b/src/entity.cpp @@ -12,6 +12,7 @@ struct DeclInfo; ENTITY_KIND(TypeName) \ ENTITY_KIND(Procedure) \ ENTITY_KIND(Builtin) \ + ENTITY_KIND(Alias) \ ENTITY_KIND(ImportName) \ ENTITY_KIND(LibraryName) \ ENTITY_KIND(Nil) \ @@ -109,6 +110,9 @@ struct Entity { i32 id; } Builtin; struct { + Entity *base; + } Alias; + struct { String path; String name; Scope *scope; @@ -232,6 +236,12 @@ Entity *make_entity_builtin(gbAllocator a, Scope *scope, Token token, Type *type return entity; } +Entity *make_entity_alias(gbAllocator a, Scope *scope, Token token, Type *type, Entity *base) { + Entity *entity = alloc_entity(a, Entity_Alias, scope, token, type); + entity->Alias.base = base; + 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); |