From: fennecdjay Date: Tue, 1 Oct 2019 20:28:10 +0000 (+0200) Subject: :fire: Old fashioned X-Git-Tag: nightly~2198^2~202 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=31593a9164ae66a5239659e1ee7c850cf8191a3c;p=gwion.git :fire: Old fashioned --- diff --git a/src/parse/check.c b/src/parse/check.c index 9017df4d..fbb4fc07 100644 --- a/src/parse/check.c +++ b/src/parse/check.c @@ -402,25 +402,10 @@ ANN static Type at_depth(const Env env, const Array_Sub array) { } static inline m_bool index_is_int(const Env env, Exp e, m_uint *depth) { -// do if(isa(e->type, env->gwion->type[et_int]) < 0) -// ERR_B(e->pos, _("array index %i must be of type 'int', not '%s'"), -// *depth, e->type->name) - - -// do CHECK_BB(check_implicit(env, "@access", e, env->gwion->type[et_int])) - - const m_str str = "@access"; - const Type t = env->gwion->type[et_int]; - const Symbol sym = insert_symbol(str); -// do CHECK_BB(check_implicit(env, str, e, t)) - do { - struct Implicit imp = { .e=e, .t=t, .pos=e->pos }; - struct Op_Import opi = { .op=sym, .lhs=e->type, - .rhs=t, .data=(uintptr_t)&imp, .pos=e->pos }; - CHECK_OB(op_check(env, &opi)) - e->nspc = env->curr; - } - +// TODO: use "@access" + do if(isa(e->type, env->gwion->type[et_int]) < 0) + ERR_B(e->pos, _("array index %i must be of type 'int', not '%s'"), + *depth, e->type->name) while(++(*depth) && (e = e->next)); return GW_OK; }