From: fennecdjay Date: Wed, 2 Oct 2019 00:28:22 +0000 (+0200) Subject: :art: Improve check_subscripts X-Git-Tag: nightly~2198^2~177 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=0a588a3f509ca664a973197687aa105dc33051d3;p=gwion.git :art: Improve check_subscripts --- diff --git a/src/parse/check.c b/src/parse/check.c index d6e94243..f0942da0 100644 --- a/src/parse/check.c +++ b/src/parse/check.c @@ -58,11 +58,8 @@ ANN m_bool check_subscripts(Env env, const Array_Sub array) { CHECK_OB(check_exp(env, array->exp)) m_uint depth = 0; Exp e = array->exp; - // TODO: use check_internal @access const Type t_int = env->gwion->type[et_int]; - do if(isa(e->type, t_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, t_int)) while(++(depth) && (e = e->next)); if(depth != array->depth) ERR_B(array->exp->pos, _("invalid array acces expression."))