From: Brendan Hansen Date: Mon, 27 Mar 2023 11:36:41 +0000 (-0500) Subject: removed: old code X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=62b77ad18184dea8e4526ff8feb577d5bb582f64;p=onyx.git removed: old code --- diff --git a/compiler/include/astnodes.h b/compiler/include/astnodes.h index 07c52d8a..58267cb5 100644 --- a/compiler/include/astnodes.h +++ b/compiler/include/astnodes.h @@ -207,7 +207,6 @@ typedef enum AstKind { Ast_Kind_For, Ast_Kind_While, Ast_Kind_Jump, - // Ast_Kind_Use, Ast_Kind_Defer, Ast_Kind_Switch, Ast_Kind_Switch_Case, @@ -776,17 +775,6 @@ struct AstDirectiveSolidify { struct AstReturn { AstNode_base; AstTyped* expr; u32 count; }; // Note: This count is one less than it should be, because internal codegen with macros would have to know about this and that is error prone. struct AstJump { AstNode_base; JumpType jump; u32 count; }; -// typedef struct QualifiedUse { -// OnyxToken* symbol_name; -// OnyxToken* as_name; -// } QualifiedUse; -// struct AstUse { -// AstNode_base; -// -// AstTyped* expr; -// bh_arr(QualifiedUse) only; -// }; - // Structure Nodes struct AstBlock { AstNode_base; diff --git a/compiler/src/astnodes.c b/compiler/src/astnodes.c index 5bead67d..c131ed06 100644 --- a/compiler/src/astnodes.c +++ b/compiler/src/astnodes.c @@ -84,7 +84,6 @@ static const char* ast_node_names[] = { "FOR", "WHILE", "JUMP", - // "USE", "DEFER", "SWITCH", "CASE", diff --git a/compiler/src/utils.c b/compiler/src/utils.c index 53804635..145f544e 100644 --- a/compiler/src/utils.c +++ b/compiler/src/utils.c @@ -55,16 +55,8 @@ Package* package_lookup_or_create(char* package_name, Scope* parent_scope, bh_al shput(context.packages, pac_name, package); - // if (!charset_contains(pac_name, '.')) { - // AstPackage* package_node = onyx_ast_node_new(alloc, sizeof(AstPackage), Ast_Kind_Package); - // package_node->package_name = package->name; - // package_node->package = package; - // package_node->type_node = builtin_package_id_type; - // package_node->flags |= Ast_Flag_Comptime; - - // symbol_raw_introduce(context.global_scope, pac_name, pos, (AstNode *) package_node); - // } - + // The builtin package is special. The 'builtin' symbol will be + // accessible even if you do not `use builtin`. if (!strcmp(pac_name, "builtin")) { AstPackage* package_node = onyx_ast_node_new(alloc, sizeof(AstPackage), Ast_Kind_Package); package_node->package_name = package->name;