From: Jérémie Astor Date: Wed, 22 Jul 2020 18:10:32 +0000 (+0200) Subject: :fire: Remove scan_parent X-Git-Tag: nightly~1429 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=dca62e7e19b5affb22d4a60418b22b816d96b028;p=gwion.git :fire: Remove scan_parent --- diff --git a/include/parse.h b/include/parse.h index 8df27eb7..320db9b4 100644 --- a/include/parse.h +++ b/include/parse.h @@ -58,10 +58,6 @@ static inline ANN m_bool env_body(const Env env, const Class_Def cdef, const _ex } #define env_body(a,b,c) env_body(a,b,(_exp_func)c) -ANN m_bool scanx_parent(const Type t, const _exp_func f, void *d); -#define scanx_parent(a,b,c) scanx_parent(a, (_exp_func)b, c) - - ANN m_bool scanx_cdef(const Env, void *,const Class_Def, const _exp_func f_cdef, const _exp_func f_union); diff --git a/src/parse/scan2.c b/src/parse/scan2.c index e927843c..5e2cf91f 100644 --- a/src/parse/scan2.c +++ b/src/parse/scan2.c @@ -560,7 +560,6 @@ ANN static m_bool scan2_parent(const Env env, const Class_Def cdef) { ANN static m_bool cdef_parent(const Env env, const Class_Def cdef) { if(cdef->base.tmpl && cdef->base.tmpl->list) CHECK_BB(template_push_types(env, cdef->base.tmpl)) -// const m_bool ret = scanx_parent(cdef->base.type, scan2_parent, env); const m_bool ret = scan2_parent(env, cdef); if(cdef->base.tmpl && cdef->base.tmpl->list) nspc_pop_type(env->gwion->mp, env->curr); diff --git a/src/parse/scanx.c b/src/parse/scanx.c index d4fc4639..c4eaa031 100644 --- a/src/parse/scanx.c +++ b/src/parse/scanx.c @@ -41,8 +41,6 @@ scanx_body(const Env e, const Class_Def c, const _exp_func f, void* d) { return ret; } -#undef scanx_parent - __attribute__((returns_nonnull)) ANN Type unflag_type(const Type t) { const Type type = !GET_FLAG(t, nonnull) ? t : t->e->parent; @@ -55,18 +53,6 @@ ANN Type get_type(const Type t) { return unflag_type(type); } -__attribute__((returns_nonnull)) -static inline Class_Def get_type_def(const Type t) { - const Type type = get_type(t); - return type->e->def; -} - -ANN m_bool -scanx_parent(const Type t, const _exp_func f, void* d) { - const Class_Def def = get_type_def(t); - return def ? f(d, def) : GW_OK; -} - ANN m_bool scanx_cdef(const Env env, void* opt, const Class_Def cdef, const _exp_func f_cdef, const _exp_func f_union) { const Type t = get_type(cdef->base.type);