ANN static m_bool emit_parent(const Emitter emit, const Class_Def cdef) {
const Type parent = cdef->base.type->e->parent;
- return scanx_parent(parent, emit_parent_inner, emit);
+ return !GET_FLAG(parent, emit) ? GW_OK : scanx_parent(parent, emit_parent_inner, emit);
}
ANN static inline m_bool emit_cdef(const Emitter emit, const Class_Def cdef) {
}
ANN static m_bool emit_class_def(const Emitter emit, const Class_Def cdef) {
- const Type type = cdef->base.type;
- const Nspc nspc = type->nspc;
if(tmpl_base(cdef->base.tmpl))
return GW_OK;
+ const Type type = cdef->base.type;
+ SET_FLAG(type, emit);
+ const Nspc nspc = type->nspc;
if(cdef->base.ext && cdef->base.ext->types)
CHECK_BB(scanx_ext(emit->env, cdef, emit_parent, emit))
nspc_allocdata(emit->gwion->mp, nspc);
if(!decl->type) // TODO: remove when scan passes are complete
ERR_O(td_pos(decl->td), "can't infer type.");
if(GET_FLAG(decl->type , template)) {
- if(!GET_FLAG(decl->type, check))
+ /*if(!GET_FLAG(decl->type, checked))*/
+ if(!GET_FLAG(decl->type, scan2))
CHECK_BO(traverse_cdef(env, decl->type->e->def))
}
const m_bool global = GET_FLAG(decl->td, global);
if(tmpl_base(cdef->base.tmpl))
return GW_OK;
const Type type = cdef->base.type;
+ SET_FLAG(type, check);
if(type->e->parent == t_undefined) {
type->e->parent = check_td(env, cdef->base.ext);
return traverse_cdef(env, cdef);
inherit(type);
if(cdef->body)
CHECK_BB(env_body(env, cdef, check_section))
- SET_FLAG(type, checked | ae_flag_check);
+ SET_FLAG(type, checked);
return GW_OK;
}
ANN m_bool scan0_class_def(const Env env, const Class_Def cdef) {
CHECK_BB(scan0_class_def_pre(env, cdef))
CHECK_OB((cdef->base.type = scan0_class_def_init(env, cdef)))
+ SET_FLAG(cdef->base.type, scan0);
if(cdef->body) {
int call = cdef->base.tmpl && !cdef->base.tmpl->call;
if(call)cdef->base.tmpl->call = (Type_List)1;
(void)mk_class(env, cdef->base.type);
if(GET_FLAG(cdef, global))
env->curr = (Nspc)vector_pop(&env->scope->nspc_stack);
- SET_FLAG(cdef->base.type, scan0);
return GW_OK;
}
CHECK_BB(scan0_class_def(env, cdef))
if(tmpl_base(cdef->base.tmpl))
return GW_OK;
+ SET_FLAG(cdef->base.type, scan1);
if(cdef->base.ext)
CHECK_BB(env_ext(env, cdef, scan1_parent))
if(cdef->body)
CHECK_BB(env_body(env, cdef, scan1_section))
- SET_FLAG(cdef->base.type, scan1);
return GW_OK;
}
ANN m_bool scan2_class_def(const Env env, const Class_Def cdef) {
if(tmpl_base(cdef->base.tmpl))
return GW_OK;
+ SET_FLAG(cdef->base.type, scan2);
if(cdef->base.ext)
CHECK_BB(env_ext(env, cdef, scan2_class_parent))
if(cdef->body)
CHECK_BB(env_body(env, cdef, scan2_section))
- SET_FLAG(cdef->base.type, scan2);
return GW_OK;
}