From 04b1409e079f0badec385007ebcf358a5b10c292 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Thu, 10 Sep 2020 22:57:21 +0200 Subject: [PATCH] :art: Make typedecl_resolve_static and rename --- include/env/env.h | 2 -- src/lib/ptr.c | 2 +- src/parse/type_decl.c | 4 ++-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/include/env/env.h b/include/env/env.h index bab36025..172008a1 100644 --- a/include/env/env.h +++ b/include/env/env.h @@ -35,8 +35,6 @@ ANN static inline m_uint env_push_global(const Env env) { return env_push(env, N ANN void env_pop(const Env, const m_uint); ANN Map env_label(const Env); ANN Type scan_type(const Env, const Type, Type_Decl*); -//ANN Type type_decl_resolve(const Env, const Type_Decl*); -ANN Type type_decl_resolve(const Env, Type_Decl*); ANN Value mk_class(const Env env, const Type base); // tl2str returns a mp_alloced string ANEW ANN m_str tl2str(const Env, const Type_List); // in type_decl.c diff --git a/src/lib/ptr.c b/src/lib/ptr.c index 84158e10..7b43095b 100644 --- a/src/lib/ptr.c +++ b/src/lib/ptr.c @@ -57,7 +57,7 @@ static OP_CHECK(opck_ptr_cast) { const Exp_Cast* cast = (Exp_Cast*)data; if(!cast->td->types || !cast->td->types->td) ERR_N(exp_self(cast)->pos, "'Ptr' needs types to cast") - DECL_ON(const Type, t, = known_type(env, cast->td)) // was type_decl_resolve + DECL_ON(const Type, t, = known_type(env, cast->td)) const Type _t = get_type(t); if(_t->e->def && !GET_FLAG(_t, check)) CHECK_BN(ensure_traverse(env, _t)) diff --git a/src/parse/type_decl.c b/src/parse/type_decl.c index 4a958224..74fa427f 100644 --- a/src/parse/type_decl.c +++ b/src/parse/type_decl.c @@ -6,7 +6,7 @@ #include "parse.h" -ANN Type type_decl_resolve(const Env env, Type_Decl* td) { +ANN static Type resolve(const Env env, Type_Decl* td) { DECL_OO(const Type, base, = find_type(env, td)) if(base->e->ctx && base->e->ctx->error) ERR_O(td_pos(td), _("type '%s' is invalid"), base->name) @@ -52,5 +52,5 @@ ANN static inline void* type_unknown(const Env env, const Type_Decl* td) { ANN Type known_type(const Env env, Type_Decl* td) { if(!td->xid) return env->gwion->type[et_undefined]; - return type_decl_resolve(env, td) ?:type_unknown(env, td); + return resolve(env, td) ?:type_unknown(env, td); } -- 2.43.0