From: fennecdjay Date: Mon, 30 Sep 2019 09:20:36 +0000 (+0200) Subject: :art: check usr ops X-Git-Tag: nightly~2198^2~213 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=f29769931151aed8d375c3df65a9616d953c9f63;p=gwion.git :art: check usr ops --- diff --git a/src/parse/scan1.c b/src/parse/scan1.c index 2d85ffcb..bd864bf4 100644 --- a/src/parse/scan1.c +++ b/src/parse/scan1.c @@ -359,12 +359,14 @@ ANN m_bool scan1_func_def(const Env env, const Func_Def fdef) { CHECK_BB(env_storage(env, fdef->flag, td_pos(fdef->base->td))) if(tmpl_base(fdef->base->tmpl)) return GW_OK; - if(fdef->base->xid == insert_symbol("@dtor") || fdef->base->xid == insert_symbol("@gack")) { - if(!env->class_def) - ERR_B(td_pos(fdef->base->td), _("'%s' must be in class def!!"), s_name(fdef->base->xid)) - if(fdef->base->args)exit(3); - } else if(GET_FLAG(fdef, op) && env->class_def) - SET_FLAG(fdef, static); + if(GET_FLAG(fdef, op)) { + if(fdef->base->xid == insert_symbol("@dtor") || fdef->base->xid == insert_symbol("@gack")) { + if(!env->class_def) + ERR_B(td_pos(fdef->base->td), _("'%s' must be in class def!!"), s_name(fdef->base->xid)) + if(fdef->base->args)exit(3); + } else if(env->class_def) + SET_FLAG(fdef, static); + } struct Func_ fake = { .name=s_name(fdef->base->xid) }, *const former = env->func; env->func = &fake; ++env->scope->depth;