mirror of
https://github.com/odin-lang/Odin.git
synced 2026-02-15 07:43:13 +00:00
*_of as keyords; Allow constant aliasing for user/built-in procedures, import names, and library names
This commit is contained in:
@@ -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) \
|
||||
@@ -108,6 +109,9 @@ struct Entity {
|
||||
struct {
|
||||
i32 id;
|
||||
} Builtin;
|
||||
struct {
|
||||
Entity *base;
|
||||
} Alias;
|
||||
struct {
|
||||
String path;
|
||||
String name;
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user