From: fennecdjay Date: Mon, 26 Feb 2024 20:11:12 +0000 (+0100) Subject: :fire: some clean X-Git-Tag: nightly~50 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=c531cc2a2d6917c8a0eb5a66c0c82a17e313e82e;p=gwion.git :fire: some clean --- diff --git a/src/import/import_checker.c b/src/import/import_checker.c index f288c401..c552d696 100644 --- a/src/import/import_checker.c +++ b/src/import/import_checker.c @@ -195,7 +195,7 @@ ANN static Arg_List fptr_args(const Gwion gwion, struct td_checker *tdc) { ANN static Type_Decl *str2td_fptr(const Gwion gwion, struct td_checker *tdc) { const m_str base = tdc->str; tdc->str++; - Type_Decl *const ret_td = _str2td(gwion, tdc); + DECL_O(Type_Decl *const, ret_td, = _str2td(gwion, tdc)); const TmplArg_List tl = td_tmpl(gwion, tdc); if (tl == TMPLARG_ERROR) { free_type_decl(gwion->mp, ret_td); diff --git a/src/import/import_internals.c b/src/import/import_internals.c index 786372ca..e64bf591 100644 --- a/src/import/import_internals.c +++ b/src/import/import_internals.c @@ -43,15 +43,10 @@ ANN static bool run_with_doc(const Gwi gwi, bool (*f)(const Gwi)) { } ANN bool gwi_run(const Gwion gwion, bool (*f)(const Gwi)) { - const m_str name = gwion->env->name; - // const Context ctx = gwion->env->context; - // gwion->env->context = NULL; OperCK oper = {}; struct Gwi_ gwi = {.gwion = gwion, .oper = &oper}; const bool ret = !gwion->data->cdoc ? f(&gwi) : run_with_doc(&gwi, f); if (!ret) gwi_reset(&gwi); - gwion->env->name = name; - // gwion->env->context = ctx; return ret; } diff --git a/src/import/import_oper.c b/src/import/import_oper.c index 22c18e39..1f6e1afb 100644 --- a/src/import/import_oper.c +++ b/src/import/import_oper.c @@ -18,11 +18,7 @@ ANN static Type _get_type(const Gwi gwi, const m_str s) { if (s == (m_str)OP_ANY_TYPE) return OP_ANY_TYPE; - // str2type - Type_Decl *td = gwi_str2td(gwi, s); - const Type t = known_type(gwi->gwion->env, td); - free_type_decl(gwi->gwion->mp, td); - return t; + return str2type(gwi->gwion, s, gwi->loc); } ANN2(1) static inline Type gwi_get_type(const Gwi gwi, const m_str str) { diff --git a/src/lib/closure.c b/src/lib/closure.c index 497c1c2f..69d7b736 100644 --- a/src/lib/closure.c +++ b/src/lib/closure.c @@ -614,8 +614,9 @@ static OP_CHECK(opck_op_impl) { // or better, some function with envset and traverse const m_uint scope = env_push_nspc(env, opi.nspc); // we assume succes here - /*const bool ret = */ traverse_func_def(env, def); + const bool ret = traverse_func_def(env, def); env_pop(env, scope); + if(!ret) return NULL; def->base->func->value_ref->type->info->parent = env->gwion->type[et_op]; impl->e->type = def->base->func->value_ref->type; impl->e->d.prim.value = def->base->func->value_ref;