Bugfix with package scopes
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Fri, 24 Jul 2020 23:54:16 +0000 (18:54 -0500)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Fri, 24 Jul 2020 23:54:16 +0000 (18:54 -0500)
onyx
src/onyxsymres.c

diff --git a/onyx b/onyx
index c60887d932277951aff5e9f3da8d50586f2ce6ce..484c0693d9084abed638e27dd23e8a0bafae2f8c 100755 (executable)
Binary files a/onyx and b/onyx differ
index 801da72e7ee2cca8805699d83e894d93d73f8afa..3fbf0ff9d1a5683f4449a0ad0bf6906ad2ea844e 100644 (file)
@@ -3,6 +3,7 @@
 #include "onyxparser.h"
 #include "onyxutils.h"
 
+
 AstBasicType basic_type_void   = { { Ast_Kind_Basic_Type, 0, NULL, "void"   }, &basic_types[Basic_Kind_Void]  };
 AstBasicType basic_type_bool   = { { Ast_Kind_Basic_Type, 0, NULL, "bool"   }, &basic_types[Basic_Kind_Bool]  };
 AstBasicType basic_type_i8     = { { Ast_Kind_Basic_Type, 0, NULL, "i8"     }, &basic_types[Basic_Kind_I8]    };
@@ -371,7 +372,7 @@ static void symres_use_package(AstUsePackage* package) {
         pac_node->package = p;
         pac_node->token = package->alias;
 
-        symbol_introduce(semstate.curr_package->include_scope, package->alias, (AstNode *) pac_node);
+        symbol_introduce(semstate.curr_package->scope, package->alias, (AstNode *) pac_node);
     }
 
     if (package->only != NULL) {
@@ -384,7 +385,7 @@ static void symres_use_package(AstUsePackage* package) {
                     "not found in package");
                 return;
             }
-            symbol_introduce(semstate.curr_package->include_scope, *tkn, thing);
+            symbol_introduce(semstate.curr_package->scope, *tkn, thing);
         }
     }