From e8b2d4659e7e15eac9652bcb31955607d676bd47 Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Sat, 18 May 2019 21:05:36 +0200 Subject: [PATCH] :art: Rename Tmpl_Class->base => call --- ast | 2 +- src/parse/scan0.c | 7 +++---- src/parse/scanx.c | 10 +++++----- src/parse/template.c | 2 +- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/ast b/ast index a3588798..1f9df9b1 160000 --- a/ast +++ b/ast @@ -1 +1 @@ -Subproject commit a35887985a376b7a69196b581ec6663d633edad6 +Subproject commit 1f9df9b1908e4ee132876d20fa7f0ce4b0cbf2f8 diff --git a/src/parse/scan0.c b/src/parse/scan0.c index 57d75ac7..dfdf7803 100644 --- a/src/parse/scan0.c +++ b/src/parse/scan0.c @@ -227,11 +227,10 @@ ANN m_bool scan0_class_def(const Env env, const Class_Def cdef) { CHECK_BB(scan0_class_def_pre(env, cdef)) CHECK_OB((cdef->base.type = scan0_class_def_init(env, cdef))) if(cdef->body) { -int call = cdef->tmpl && !cdef->tmpl->base; -if(call)cdef->tmpl->base = 1; -// assert(cdef->tmpl->base); +int call = cdef->tmpl && !cdef->tmpl->call; +if(call)cdef->tmpl->call = (Type_List)1; CHECK_BB(env_body(env, cdef, scan0_section)) -if(call)cdef->tmpl->base = NULL; +if(call)cdef->tmpl->call = NULL; } (void)mk_class(env, cdef->base.type); if(GET_FLAG(cdef, global)) diff --git a/src/parse/scanx.c b/src/parse/scanx.c index ab0e1eef..5195702c 100644 --- a/src/parse/scanx.c +++ b/src/parse/scanx.c @@ -18,21 +18,21 @@ ANN static inline m_bool _body(const Env e, Class_Body b, const _exp_func f) { ANN static inline m_int _push(const Env env, const Class_Def c) { const m_uint scope = env_push_type(env, c->base.type); if(c->tmpl) { - if(!c->tmpl->base) + if(!c->tmpl->call) ERR_B(c->pos, "you must provide template types for type '%s'", s_name(c->base.xid)) - if(c->tmpl->base != 1) - CHECK_BB(template_push_types(env, c->tmpl->list.list, c->tmpl->base)) + if(c->tmpl->call != (Type_List)1) + CHECK_BB(template_push_types(env, c->tmpl->list.list, c->tmpl->call)) } return scope; } ANN static inline void _pop(const Env e, const Class_Def c, const m_uint s) { if(c->tmpl) { - if(c->tmpl->base != 1) + if(c->tmpl->call != (Type_List)1) nspc_pop_type(e->gwion->mp, e->curr); else - c->tmpl->base = NULL; + c->tmpl->call = NULL; } env_pop(e, s); } diff --git a/src/parse/template.c b/src/parse/template.c index 1193968c..40dfa568 100644 --- a/src/parse/template.c +++ b/src/parse/template.c @@ -156,7 +156,7 @@ ANN Type scan_type(const Env env, const Type t, const Type_Decl* type) { if(a->base.type) return a->base.type; a->tmpl = new_tmpl_class(env->gwion->mp, get_total_type_list(env, t), 0); - a->tmpl->base = type->types; + a->tmpl->call = type->types; CHECK_BO(scan0_class_def(env, a)) SET_FLAG(a->base.type, template | ae_flag_ref); -- 2.43.0