From: fennecdjay Date: Tue, 5 Nov 2019 19:27:44 +0000 (+0100) Subject: :art: Clean env_utils X-Git-Tag: nightly~2115^2~5 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=a794aa24213a8d71ef67d3b686c0b7f8b1615346;p=gwion.git :art: Clean env_utils --- diff --git a/src/oo/env_utils.c b/src/oo/env_utils.c index caa3a4d2..7bec6eb5 100644 --- a/src/oo/env_utils.c +++ b/src/oo/env_utils.c @@ -34,16 +34,20 @@ ANN m_bool env_storage(const Env env, ae_flag flag, const loc_t pos) { return !(env->class_def && GET(flag, ae_flag_global)) ? GW_OK :GW_ERROR; } -ANN Type find_type(const Env env, ID_List path) { - Type type = nspc_lookup_type1(env->curr, path->xid); -if(!type && env->class_def) { - Type base = env->class_def->e->parent; - while(base && base->nspc) { - if((type = nspc_lookup_type1(base->nspc, path->xid))) - break; +ANN Type _find_type(const Env env, const Symbol xid) { + Type type = nspc_lookup_type1(env->curr, xid); + if(!type && env->class_def) { + Type base = env->class_def->e->parent; + while(base && base->nspc) { + if((type = nspc_lookup_type1(base->nspc, xid))) + break; + } } + return type; } +ANN Type find_type(const Env env, ID_List path) { + Type type = _find_type(env, path->xid); CHECK_OO(type) Nspc nspc = type->nspc; path = path->next;