const Symbol sym = insert_symbol(type->name);
nspc_add_type_front(env->curr, sym, type);
const Value v = new_value(env->gwion->mp, v_type, s_name(sym));
- SET_FLAG(v, checked | ae_flag_const | ae_flag_global | ae_flag_builtin);
+ SET_FLAG(v, valid | ae_flag_const | ae_flag_global | ae_flag_builtin);
nspc_add_value(env->curr, insert_symbol(type->name), v);
v->from->owner = type->e->owner = env->curr;
v->from->owner_class = type->e->owner_class = env->class_def; // t owner_class ?
const Symbol sym = insert_symbol(base->name);
const Value v = new_value(env->gwion->mp, t, s_name(sym));
valuefrom(env, v->from);
- SET_FLAG(v, const | ae_flag_checked);
+ SET_FLAG(v, const | ae_flag_valid);
nspc_add_value_front(base->e->owner, sym, v);
return v;
}
t->e->d.base_type = array_base(src) ?: src;
t->e->owner = src->e->owner;
ADD_REF((t->nspc = env->gwion->type[et_array]->nspc))
- SET_FLAG(t, checked);
+ SET_FLAG(t, valid);
mk_class(env, t);
nspc_add_type_front(src->e->owner, sym, t);
return t;
ANN2(1,2) static inline m_bool class_parent(const Env env, const Type t) {
Type parent = t->e->parent;
- while(parent && !GET_FLAG(parent, checked)) {
+ while(parent && !GET_FLAG(parent, valid)) {
if(t->e->def)
CHECK_BB(traverse_class_def(env, t->e->def))
parent = parent->e->parent;
inherit(t);
t->e->owner = env->curr;
t->e->owner_class = env->class_def;
- SET_FLAG(t, checked);
+ SET_FLAG(t, valid);
env_push_type(env, t);
}
const Type t_object = gwi_mk_type(gwi, "Object", SZ_INT, NULL);
gwi_add_type(gwi, t_object);
GWI_BB(gwi_gack(gwi, t_object, gack_object))
- SET_FLAG(t_object, checked); // should be set by gwi_add_type
+ SET_FLAG(t_object, valid); // should be set by gwi_add_type
gwi->gwion->type[et_object] = t_object;
// struct SpecialId_ spid = { .ck=check_this, .exec=RegPushMem, .is_const=1 };
struct SpecialId_ spid = { .ck=opck_this, .em=opem_this, .is_const=1 };
CHECK_BB(check_var_td(env, var, decl->td))
if(is_fptr(env->gwion, decl->type))
CHECK_BB(check_fptr_decl(env, var))
- SET_FLAG(var->value, checked | ae_flag_used);
+ SET_FLAG(var->value, valid | ae_flag_used);
nspc_add_value(env->curr, var->xid, var->value);
} while((list = list->next));
return GW_OK;
ANN static Type prim_id_non_res(const Env env, const Symbol *data) {
const Symbol var = *data;
const Value v = check_non_res_value(env, data);
- if(!v || !GET_FLAG(v, checked) || (v->from->ctx && v->from->ctx->error)) {
+ if(!v || !GET_FLAG(v, valid) || (v->from->ctx && v->from->ctx->error)) {
env_err(env, prim_pos(data),
_("variable %s not legit at this point."), s_name(var));
did_you_mean_nspc(value_owner(v) ?: env->curr, s_name(var));
}
static Func ensure_tmpl(const Env env, const Func_Def fdef, const Exp_Call *exp) {
- const m_bool ret = GET_FLAG(fdef, checked) || traverse_func_def(env, fdef) > 0;
+ const m_bool ret = GET_FLAG(fdef, valid) || traverse_func_def(env, fdef) > 0;
if(ret) {
const Func f = fdef->base->func;
const Func next = f->next;
const Func func = find_func_match(env, f, exp->args);
f->next = next;
if(func) {
- SET_FLAG(func, checked | ae_flag_template);
+ SET_FLAG(func, valid | ae_flag_template);
return func;
}
}
if(isa(v->type, env->gwion->type[et_object]) > 0 || isa(v->type, env->gwion->type[et_function]) > 0)
UNSET_FLAG(env->func, pure);
CHECK_BB(already_defined(env, decl->xid, decl->pos))
- SET_FLAG(v, checked);
+ SET_FLAG(v, valid);
nspc_add_value(env->curr, decl->xid, v);
} while((arg_list = arg_list->next));
return GW_OK;
}
t = depth ? array_type(env, ptr, depth) : ptr;
stmt->v = new_value(env->gwion->mp, t, s_name(stmt->sym));
- SET_FLAG(stmt->v, checked);
+ SET_FLAG(stmt->v, valid);
nspc_add_value(env->curr, stmt->sym, stmt->v);
return check_conts(env, stmt_self(stmt), stmt->body);
}
env->class_def->nspc->info->offset = udef->o + udef->s;
union_pop(env, udef, scope);
union_flag(udef, ae_flag_check);
- union_flag(udef, ae_flag_checked);
+ union_flag(udef, ae_flag_valid);
return ret;
}
const Symbol sym = prim->d.var;
const Value v = new_value(env->gwion->mp,
((Exp)VKEY(&env->scope->match->map, i))->info->type, s_name(sym));
- SET_FLAG(v, checked);
+ SET_FLAG(v, valid);
nspc_add_value(env->curr, sym, v);
VVAL(&env->scope->match->map, i) = (vtype)v;
return v;
--env->scope->depth;
env->func = former;
if(ret > 0)
- SET_FLAG(fdef, checked);
+ SET_FLAG(fdef, valid);
if(GET_FLAG(fdef, global))
env_pop(env,scope);
return ret;
inherit(t);
if(cdef->body)
CHECK_BB(env_body(env, cdef, check_section))
- SET_FLAG(t, checked);
+ SET_FLAG(t, valid);
return GW_OK;
}
tdef->type = t;
if(base->nspc)
ADD_REF((t->nspc = base->nspc));
- t->flag = tdef->ext->flag | ae_flag_checked;
+ t->flag = tdef->ext->flag | ae_flag_valid;
scan0_implicit_similar(env, t, base);
if(tdef->ext->array && !tdef->ext->array->exp)
SET_FLAG(t, empty);
const Value v = new_value(env->gwion->mp, t, s_name(sym));
valuefrom(env, v->from);
nspc_add_value(env->curr, sym, v);
- SET_FLAG(v, checked | ae_flag_pure);
+ SET_FLAG(v, valid | ae_flag_pure);
return v;
}
CHECK_BB(scan0_defined(env, udef->type_xid, udef->pos))
udef->type = union_type(env, udef->type_xid, 1);
SET_ACCESS(udef, udef->type);
- SET_FLAG(udef->type, checked);
+ SET_FLAG(udef->type, valid);
} else {
const Symbol sym = scan0_sym(env, "union", udef->pos);
CHECK_BB(scan0_defined(env, sym, udef->pos))
SET_ACCESS(edef, v)
SET_ACCESS(edef, edef->t)
}
- SET_FLAG(v, const | ae_flag_enum | ae_flag_checked);
+ SET_FLAG(v, const | ae_flag_enum | ae_flag_valid);
nspc_add_value(edef->t->e->owner, list->xid, v);
vector_add(&edef->values, (vtype)v);
} while((list = list->next));
ANN m_bool scan1_union_def_action(const Env env, const Union_Def udef,
const Decl_List l) {
const Exp_Decl decl = l->self->d.exp_decl;
- SET_FLAG(decl.td, checked | udef->flag);
+ SET_FLAG(decl.td, valid | udef->flag);
const m_bool global = GET_FLAG(udef, global);
if(global)
UNSET_FLAG(decl.td, global);
const m_str name = s_name(f->base->xid);
const Func func = scan_new_func(env, f, name);
const Value value = func_value(env, func, overload);
- SET_FLAG(value, checked | ae_flag_template);
+ SET_FLAG(value, valid | ae_flag_template);
SET_FLAG(value->type, func); // the only types with func flag, name could be better
Type type = env->class_def;
Nspc nspc = env->curr;
if(!base) {
if(GET_FLAG(f, op))
CHECK_BB(scan2_func_def_op(env, f))
- SET_FLAG(f->base->func->value_ref, checked);
+ SET_FLAG(f->base->func->value_ref, valid);
}
return GW_OK;
}
CHECK_BB(scan1_class_def(env, def))
if(!GET_FLAG(t, scan2))
CHECK_BB(scan2_class_def(env, def))
- if(!GET_FLAG(t, checked))
+ if(!GET_FLAG(t, valid))
return check_class_def(env, def);
return GW_OK;
}
-Subproject commit 3765afd505c6da83445f07552e471bf4cc180a4c
+Subproject commit 10ae3a6aa18006fb407519e057ef0ed7ad8232ea