ANN m_bool compat_func(const __restrict__ Func_Def, const __restrict__ Func_Def);
ANN Type known_type(const Env env, const Type_Decl*);
ANN m_bool env_access(const Env env, const ae_flag flag);
-ANN void env_storage(const Env env, ae_flag* flag);
+ANN m_bool env_storage(const Env env, ae_flag flag);
ANN void env_add_type(const Env, const Type);
ANN Type find_type(const Env, ID_List);
ANN m_bool already_defined(const Env env, const Symbol s, const uint pos);
return GW_OK;
}
-ANN void env_storage(const Env env, ae_flag* flag) {
- if(env->class_def && GET(*flag, ae_flag_global))
- *flag &= (uint)~ae_flag_global;
+ANN m_bool env_storage(const Env env, ae_flag flag) {
+ CHECK_BB(env_access(env, flag))
+ return !(env->class_def && GET(flag, ae_flag_global)) ? GW_OK :GW_ERROR;
}
ANN static Type find_typeof(const Env env, ID_List path) {
}
ANN m_bool scan0_stmt_enum(const Env env, const Stmt_Enum stmt) { GWDEBUG_EXE
- CHECK_BB(env_access(env, stmt->flag))
- env_storage(env, &stmt->flag);
+ CHECK_BB(env_storage(env, stmt->flag))
if(stmt->xid) {
const Value v = nspc_lookup_value1(env->curr, stmt->xid);
if(v)
}
ANN static m_bool scan0_stmt_union(const Env env, const Stmt_Union stmt) { GWDEBUG_EXE
- CHECK_BB(env_access(env, stmt->flag))
- env_storage(env, &stmt->flag);
+ CHECK_BB(env_storage(env, stmt->flag))
if(stmt->xid) {
CHECK_BB(scan0_defined(env, stmt->xid, stmt->self->pos))
const Nspc nspc = !GET_FLAG(stmt, global) ?
}
ANN static m_bool scan0_class_def_pre(const Env env, const Class_Def class_def) { GWDEBUG_EXE
- CHECK_BB(env_access(env, class_def->flag))
- env_storage(env, &class_def->flag);
+ CHECK_BB(env_storage(env, class_def->flag))
if(GET_FLAG(class_def, global)) {
vector_add(&env->scope->nspc_stack, (vtype)env->curr);
env->curr = env->global_nspc;
}
ANN m_bool scan1_exp_decl(const Env env, Exp_Decl* decl) { GWDEBUG_EXE
- CHECK_BB(env_access(env, decl->td->flag))
- env_storage(env, &decl->td->flag);
+ CHECK_BB(env_storage(env, decl->td->flag))
Var_Decl_List list = decl->list;
((Exp_Decl*)decl)->type = scan1_exp_decl_type(env, (Exp_Decl*)decl);
CHECK_OB(decl->type)
}
ANN m_bool scan1_func_def(const Env env, const Func_Def f) { GWDEBUG_EXE
- CHECK_BB(env_access(env, f->flag))
- env_storage(env, &f->flag);
+ CHECK_BB(env_storage(env, f->flag))
if(tmpl_list_base(f->tmpl))
return GW_OK;
const Func former = env->func;