diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-10-04 23:10:43 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-10-04 23:10:43 -0400 |
| commit | a4cb5ffafc050b519f806f74f0160ad48f76bee6 (patch) | |
| tree | 7a55f9b2e7c680eaccfa81c3734efdda71e848a3 /src/compile/files.c | |
| parent | 4cb2ea78760fabcbf526dee5962a6bf4896639f3 (diff) | |
Deprecate `extend`
Diffstat (limited to 'src/compile/files.c')
| -rw-r--r-- | src/compile/files.c | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/src/compile/files.c b/src/compile/files.c index f331a50a..a4cc07fe 100644 --- a/src/compile/files.c +++ b/src/compile/files.c @@ -48,8 +48,6 @@ void initialize_vars_and_statics(env_t *env, ast_t *ast) { initialize_namespace(env, Match(stmt->ast, EnumDef)->name, Match(stmt->ast, EnumDef)->namespace); } else if (stmt->ast->tag == LangDef) { initialize_namespace(env, Match(stmt->ast, LangDef)->name, Match(stmt->ast, LangDef)->namespace); - } else if (stmt->ast->tag == Extend) { - initialize_namespace(env, Match(stmt->ast, Extend)->name, Match(stmt->ast, Extend)->body); } else if (stmt->ast->tag == Use) { continue; } else { @@ -137,19 +135,6 @@ Text_t compile_top_level_code(env_t *env, ast_t *ast) { ", .metamethods=Text$metamethods, .tag=TextInfo, .TextInfo={", quoted_str(def->name), "}};\n"); return Texts(code, compile_namespace(env, def->name, def->namespace)); } - case Extend: { - DeclareMatch(extend, ast, Extend); - binding_t *b = get_binding(env, extend->name); - if (!b || b->type->tag != TypeInfoType) - code_err(ast, "'", extend->name, "' is not the name of any type I recognize."); - env_t *ns_env = Match(b->type, TypeInfoType)->env; - env_t *extended = new (env_t); - *extended = *ns_env; - extended->locals = new (Table_t, .fallback = env->locals); - extended->namespace_bindings = new (Table_t, .fallback = env->namespace_bindings); - extended->id_suffix = env->id_suffix; - return compile_top_level_code(extended, extend->body); - } case Block: { Text_t code = EMPTY_TEXT; for (ast_list_t *stmt = Match(ast, Block)->statements; stmt; stmt = stmt->next) { |
