-Subproject commit 17bb211543ca36b9c53d884515afded758547945
+Subproject commit d58f01e7f844cab87613a8084dee3e69d1582cac
ANN m_bool traverse_func_template(const Env, const Func_Def);
ANN void env_err(const Env, const loc_t pos, const m_str fmt, ...);
ANN void env_warn(const Env, const loc_t pos, const m_str fmt, ...);
+ANN void env_error_footer(const Env env);
ANN Value global_string(const Env env, const m_str str);
ANN void release_ctx(struct Env_Scope_ *a, struct Gwion_* gwion);
-Subproject commit 4587cd028705ac2766c1897bb5d1e398b0b1de46
+Subproject commit fb296d97fea12ee3e44a1120c47033dfe5325a62
mempool_end(gwion->mp);
}
-ANN static void env_header(const Env env) {
+ANN void env_error_footer(const Env env) {
if(env->class_def)
gwerr_secondary("in class", env->name, env->class_def->info->cdef->pos);
- if(env->func && env->func != (Func)1 && env->func->def)
+ if(env->func && env->func->def)
gwerr_secondary("in function", env->name, env->func->def->base->pos);
}
char c[size + 1];
vsprintf(c, fmt, arg);
gwerr_basic(c, NULL, NULL, env->name, pos, 0);
- env_header(env);
+ env_error_footer(env);
#endif
}
}
CHECK_BN(not_from_owner_class(env, the_base, value, exp_self(member)->pos));
if(!env->class_def || isa(env->class_def, value->from->owner_class) < 0) {
- if(GET_FLAG(value, private))
- ERR_N(exp_self(member)->pos,
- _("can't access private '%s' outside of class..."), value->name);
- else if(GET_FLAG(value, protect))
+ if(GET_FLAG(value, private)) {
+ gwerr_basic("invalid variable access", "is private", NULL,
+ env->name, exp_self(member)->pos, 0);
+ env_error_footer(env);
+ gwerr_secondary("declared here", value->from->filename, value->from->loc);
+ env->context->error = true;
+ } else if(GET_FLAG(value, protect))
exp_setprot(exp_self(member), 1);
}
if(base_static && vflag(value, vflag_member))