mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-19 12:22:23 -07:00
#import "" as namespace
This commit is contained in:
+19
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user