Fix codegen scope names

This commit is contained in:
Krzosa Karol
2022-06-13 20:35:45 +02:00
parent 2c431e3207
commit 30f448a490
3 changed files with 3 additions and 1 deletions

View File

@@ -172,7 +172,7 @@ function void
gen_expr(Ast_Expr *ast){
switch(ast->kind){
CASE(IDENT, Atom){
gen_scope_name(node->parent_scope);
gen_scope_name(node->resolved_decl->parent_scope);
gen("%s", node->intern_val.str);
BREAK();
}

View File

@@ -50,6 +50,7 @@ want to export all the symbols, we can namespace them optionally.
[ ] - Some way to take slice of data
[ ] - slices should be properly displayed in debugger
[ ] - elif
[ ] - Hex 0x42
[ ] - #assert that handles constants at compile time and vars at runtime
[ ] - Comma notation when declaring variables thing1, thing2: S32

View File

@@ -645,6 +645,7 @@ resolve_field_access(Ast_Expr *node, Ast_Scope *context){
Ast_Scope *scope = context ? context : node->parent_scope;
Search_Flag flag = context ? SEARCH_ONLY_CURRENT_SCOPE : 0;
Ast_Decl *decl = resolve_name(scope, node->pos, ident->intern_val, flag);
ident->resolved_decl = decl;
if(decl->kind == AST_FILE_NAMESPACE || decl->kind == AST_MODULE_NAMESPACE){
assert(next);
return resolve_field_access(next, decl->scope);