From: fennecdjay Date: Sat, 18 May 2019 19:15:10 +0000 (+0200) Subject: :art: Expand Tmpl_List in Tmpl_Class X-Git-Tag: nightly~2454^2~2 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=4d1e0ec4064f9df84ed9fac5084a2a5a47da349e;p=gwion.git :art: Expand Tmpl_List in Tmpl_Class --- diff --git a/ast b/ast index 1f9df9b1..fe0bdff5 160000 --- a/ast +++ b/ast @@ -1 +1 @@ -Subproject commit 1f9df9b1908e4ee132876d20fa7f0ce4b0cbf2f8 +Subproject commit fe0bdff5928947b832ec50726f96979a534d08f9 diff --git a/src/parse/scanx.c b/src/parse/scanx.c index 5195702c..b8723954 100644 --- a/src/parse/scanx.c +++ b/src/parse/scanx.c @@ -22,7 +22,7 @@ ANN static inline m_int _push(const Env env, const Class_Def c) { ERR_B(c->pos, "you must provide template types for type '%s'", s_name(c->base.xid)) if(c->tmpl->call != (Type_List)1) - CHECK_BB(template_push_types(env, c->tmpl->list.list, c->tmpl->call)) + CHECK_BB(template_push_types(env, c->tmpl->list, c->tmpl->call)) } return scope; } diff --git a/src/parse/template.c b/src/parse/template.c index 40dfa568..aff4b293 100644 --- a/src/parse/template.c +++ b/src/parse/template.c @@ -19,7 +19,7 @@ ANN static inline Type owner_type(const Env env, const Type t) { ANEW ANN static Vector get_types(const Env env, Type t) { const Vector v = new_vector(env->gwion->mp); do if(GET_FLAG(t, template)) - vector_add(v, (vtype)t->e->def->tmpl->list.list); + vector_add(v, (vtype)t->e->def->tmpl->list); while((t = owner_type(env, t))); return v; } @@ -35,12 +35,12 @@ ANEW ANN static ID_List id_list_copy(MemPool p, ID_List src) { ANN static ID_List get_total_type_list(const Env env, const Type t) { const Type parent = owner_type(env, t); if(!parent) - return t->e->def->tmpl ? t->e->def->tmpl->list.list : NULL; + return t->e->def->tmpl ? t->e->def->tmpl->list : NULL; const Vector v = get_types(env, parent); const ID_List base = (ID_List)vector_pop(v); if(!base) { free_vector(env->gwion->mp, v); - return t->e->def->tmpl ? t->e->def->tmpl->list.list : NULL; + return t->e->def->tmpl ? t->e->def->tmpl->list : NULL; } const ID_List types = id_list_copy(env->gwion->mp, base); ID_List list, tmp = types; @@ -48,7 +48,7 @@ ANN static ID_List get_total_type_list(const Env env, const Type t) { list = (ID_List)vector_pop(v); tmp = (tmp->next = id_list_copy(env->gwion->mp, list)); } - tmp->next = t->e->def->tmpl->list.list; + tmp->next = t->e->def->tmpl->list; free_vector(env->gwion->mp, v); return types; } @@ -69,7 +69,7 @@ ANN static inline size_t tmpl_set(struct tmpl_info* info, const Type t) { } ANN static size_t template_size(const Env env, struct tmpl_info* info) { - ID_List base = info->cdef->tmpl->list.list; + ID_List base = info->cdef->tmpl->list; size_t size = tmpl_set(info, info->cdef->base.type); do size += tmpl_set(info, type_decl_resolve(env, info->call->td)); while((info->call = info->call->next) && (base = base->next) && ++size); @@ -149,7 +149,7 @@ ANN Type scan_type(const Env env, const Type t, const Type_Decl* type) { if(!type->types) ERR_O(t->e->def->pos, "you must provide template types for type '%s'", t->name) - if(template_match(t->e->def->tmpl->list.list, type->types) < 0) + if(template_match(t->e->def->tmpl->list, type->types) < 0) ERR_O(type->xid->pos, "invalid template types number") const Class_Def a = template_class(env, t->e->def, type->types); SET_FLAG(a, ref);