From: fennecdjay Date: Mon, 26 Feb 2024 17:55:36 +0000 (+0100) Subject: :fire: remove env_footer X-Git-Tag: nightly~56 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=851d4d27bbd2cc648be2e571236746dfc1a6f5c3;p=gwion.git :fire: remove env_footer --- diff --git a/include/env/env.h b/include/env/env.h index 9a3b4aeb..3e46f75f 100644 --- a/include/env/env.h +++ b/include/env/env.h @@ -64,7 +64,6 @@ ANN void env_add_type(const Env, const Type, const loc_t); ANN Type find_type(const Env, Type_Decl *); ANN void env_err(const Env, const loc_t, const m_str fmt, ...); ANN void env_warn(const Env, const loc_t, const m_str fmt, ...); -ANN void env_error_footer(const Env env); ANN Value global_string(const Env env, const m_str str, const loc_t); ANN void release_ctx(struct Env_Scope_ *a, struct Gwion_ *gwion); diff --git a/src/env/env_utils.c b/src/env/env_utils.c index 48e1dcf1..d82ccaf6 100644 --- a/src/env/env_utils.c +++ b/src/env/env_utils.c @@ -70,7 +70,6 @@ ANN bool can_define(const Env env, const Symbol s, const loc_t loc) { if (!v || is_class(env->gwion, v->type)) return true; gwerr_basic(_("already declared as variable"), NULL, NULL, env->name, loc, 0); declared_here(v); - env_error_footer(env); return false; } diff --git a/src/gwion.c b/src/gwion.c index b6522325..7ff6ac0a 100644 --- a/src/gwion.c +++ b/src/gwion.c @@ -177,21 +177,6 @@ ANN void gwion_end(const Gwion gwion) { mempool_end(gwion->mp); } -ANN void env_error_footer(const Env env) { - bool ctor = false; - if (env->func && env->func->def) { - if(!is_ctor(env->func->def)) - gwerr_secondary("in function", env->name, env->func->def->base->tag.loc); - else { - gwerr_secondary("in class pre constructor", env->name, - env->class_def->info->cdef->base.tag.loc); - ctor = true; - } - } - if (!ctor && env->class_def && tflag(env->class_def, tflag_cdef)) - gwerr_secondary("in class", env->name, env->class_def->info->cdef->base.tag.loc); -} - ANN static void env_xxx(const Env env, const loc_t loc, const m_str fmt, va_list arg) { #ifndef __FUZZING__ @@ -202,7 +187,6 @@ ANN static void env_xxx(const Env env, const loc_t loc, const m_str fmt, char c[size + 1]; vsprintf(c, fmt, arg); gwerr_basic(c, NULL, NULL, env->name, loc, 0); - env_error_footer(env); #endif } @@ -216,7 +200,6 @@ ANN static void _env_warn(const Env env, const loc_t loc, const m_str fmt, char c[size + 1]; vsprintf(c, fmt, arg); gwerr_warn(c, NULL, NULL, env->name, loc); - env_error_footer(env); #endif } diff --git a/src/lib/object_op.c b/src/lib/object_op.c index 25821d23..fd271dd6 100644 --- a/src/lib/object_op.c +++ b/src/lib/object_op.c @@ -187,7 +187,6 @@ ANN static bool member_access(const Env env, Exp* exp, const Value value) { if (GET_FLAG(value, private)) { gwerr_basic("invalid variable access", "is private", NULL, env->name, exp->loc, 0); - env_error_footer(env); defined_here(value); env_set_error(env, true); return false; diff --git a/src/parse/check.c b/src/parse/check.c index 89188f4f..a947218b 100644 --- a/src/parse/check.c +++ b/src/parse/check.c @@ -2271,7 +2271,6 @@ ANN static bool _check_class_def(const Env env, const Class_Def cdef) { ID_List list = cdef->traits; if (!check_trait_requests(env, t, list, t->info->value->from)) { env->class_def = t; - env_error_footer(env); env_set_error(env, true); return false; }