From: Brendan Hansen Date: Fri, 24 Jul 2020 23:54:16 +0000 (-0500) Subject: Bugfix with package scopes X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=b8e103e8c5da99bdcfc86db38ac17d707531d41e;p=onyx.git Bugfix with package scopes --- diff --git a/onyx b/onyx index c60887d9..484c0693 100755 Binary files a/onyx and b/onyx differ diff --git a/src/onyxsymres.c b/src/onyxsymres.c index 801da72e..3fbf0ff9 100644 --- a/src/onyxsymres.c +++ b/src/onyxsymres.c @@ -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); } }