return str ? _get_type(gwi, str) : NULL;
}
-ANN2(1,2) static int import_op(const Gwi gwi, const struct OperCK* op,
+ANN2(1,2) static int import_op(const Gwi gwi, struct OperCK*const op,
const f_instr f) {
const Type lhs = gwi_get_type(gwi, op->lhs),
rhs = gwi_get_type(gwi, op->rhs),
const struct Op_Func opfunc = { .ck=op->ck, .em=op->em, .effect = { .ptr=op->effect.ptr } };
const struct Op_Import opi = { .lhs=lhs, .rhs=rhs, .ret=ret,
.func=&opfunc, .data=(uintptr_t)f, .pos=gwi->loc, .op=op->sym };
- return add_op(gwi->gwion, &opi);
+ const m_bool b = add_op(gwi->gwion, &opi);
+ op->effect.ptr = NULL;
+ return b;
}
if(opi->func) {
mo->ck = opi->func->ck;
mo->em = opi->func->em;
+ if(opi->func->effect.ptr) {
+if(opi->lhs && opi->lhs != OP_ANY_TYPE)
+puts(opi->lhs->name);
+ mo->effect.ptr = opi->func->effect.ptr;
+}
}
return mo;
}