Ast body;
struct ImportCK *ck;
struct OperCK *oper; // _misc
+ struct Vector_ effects;
uint tmpls;
loc_t loc;
};
return new_tmpl_base(gwi->gwion->mp, gwi->ck->tmpl);
}
+ANN void gwi_effects(const Gwi gwi, const m_str name);
ANN m_bool gwi_run(const Gwion gwion, m_bool (*f)(const Gwi));
#endif
--gwi->tmpls;
nspc_pop_type(gwi->gwion->mp, gwi->gwion->env->curr);
}
+ if(gwi->effects.ptr) {
+ vector_init(&t->effects);
+ vector_copy2(&gwi->effects, &t->effects);
+ vector_release(&gwi->effects);
+ }
env_pop(gwi->gwion->env, 0);
return GW_OK;
}
ANEW ANN static Func_Def import_fdef(const Gwi gwi, ImportCK *ck) {
Func_Base* base = gwi_func_base(gwi, ck);
const Func_Def fdef = new_func_def(gwi->gwion->mp, base, NULL);
+ if(gwi->effects.ptr) {
+ vector_init(&fdef->base->effects);
+ vector_copy2(&gwi->effects, &fdef->base->effects);
+ vector_release(&gwi->effects);
+ }
return fdef;
}
ANN VM* gwi_vm(const Gwi gwi) {
return gwi->gwion->vm;
}
+
+ANN void gwi_effects(const Gwi gwi, const m_str name) {
+ if(!gwi->effects.ptr)
+ vector_init(&gwi->effects);
+ const Symbol sym = insert_symbol(gwi->gwion->st, name);
+ vector_add(&gwi->effects, (m_uint)sym);
+}