diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-07-04 11:23:48 +0100 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-07-04 11:23:48 +0100 |
| commit | 689a0c0b4955e5325c5409855632a3d4a154b41e (patch) | |
| tree | 9b6283b8620f053f33025cf7511daef71d261d03 /src/entity.cpp | |
| parent | bc16b290ba6c2168baf1153b4c7691e679f68b46 (diff) | |
*_of as keyords; Allow constant aliasing for user/built-in procedures, import names, and library names
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); |