func->code->memoize = memoize_ini(emit, func);
}
-ANN m_bool emit_func_def(const Emitter emit, const Func_Def f) {
+ANN m_bool _emit_func_def(const Emitter emit, const Func_Def f) {
if (tmpl_base(f->base->tmpl) && fbflag(f->base, fbflag_op)) return GW_OK;
const Func func = f->base->func;
const Func_Def fdef = func->def;
return ret;
}
+ANN m_bool emit_func_def(const Emitter emit, const Func_Def fdef) {
+ const uint16_t depth = emit->env->scope->depth;
+ emit->env->scope->depth = 0;
+ const m_bool ret = _emit_func_def(emit, fdef);
+ emit->env->scope->depth = depth;
+ return ret;
+}
+
ANN static m_bool emit_extend_def(const Emitter emit, const Extend_Def xdef);
#define emit_fptr_def dummy_func
#define emit_trait_def dummy_func
return GW_OK;
}
-ANN m_bool check_func_def(const Env env, const Func_Def f) {
+ANN m_bool _check_func_def(const Env env, const Func_Def f) {
if (tmpl_base(f->base->tmpl) && fbflag(f->base, fbflag_op)) return GW_OK;
const Func func = f->base->func;
const Func_Def fdef = func->def;
return ret;
}
+ANN m_bool check_func_def(const Env env, const Func_Def fdef) {
+ const uint16_t depth = env->scope->depth;
+ env->scope->depth = 0;
+ const m_bool ret = _check_func_def(env, fdef);
+ env->scope->depth = depth;
+ return ret;
+}
+
ANN static m_bool check_extend_def(const Env env, const Extend_Def xdef) {
CHECK_BB(ensure_check(env, xdef->t));
CHECK_BB(extend_push(env, xdef->t));
return GW_OK;
}
-ANN m_bool scan1_func_def(const Env env, const Func_Def fdef) {
+ANN static m_bool _scan1_func_def(const Env env, const Func_Def fdef) {
const bool global = GET_FLAG(fdef->base, global);
const m_uint scope = !global ? env->scope->depth : env_push_global(env);
if (fdef->base->td)
return ret;
}
+ANN m_bool scan1_func_def(const Env env, const Func_Def fdef) {
+ const uint16_t depth = env->scope->depth;
+ env->scope->depth = 0;
+ const m_bool ret = _scan1_func_def(env, fdef);
+ env->scope->depth = depth;
+ return ret;
+}
+
ANN static m_bool scan1_extend_def(const Env env, const Extend_Def xdef) {
CHECK_BB(ensure_scan1(env, xdef->t));
CHECK_BB(extend_push(env, xdef->t));
(fdef->base->tmpl && !fdef->base->tmpl->call);
}
-ANN m_bool scan2_func_def(const Env env, const Func_Def fdef) {
+ANN m_bool _scan2_func_def(const Env env, const Func_Def fdef) {
if (tmpl_base(fdef->base->tmpl) && fbflag(fdef->base, fbflag_op))
return GW_OK;
if(!strcmp(s_name(fdef->base->xid), "new")) {
return GW_OK;
}
+ANN m_bool scan2_func_def(const Env env, const Func_Def fdef) {
+ const uint16_t depth = env->scope->depth;
+ env->scope->depth = 0;
+ const m_bool ret = _scan2_func_def(env, fdef);
+ env->scope->depth = depth;
+ return ret;
+}
+
ANN static m_bool scan2_extend_def(const Env env, const Extend_Def xdef) {
CHECK_BB(ensure_scan2(env, xdef->t));
CHECK_BB(extend_push(env, xdef->t));