ANN m_bool op_emit(const Emitter, const struct Op_Import*);
ANN m_bool operator_set_func(const struct Op_Import*);
ANN void free_op_map(Map map, struct Gwion_* gwion);
-ANN m_bool env_add_op(const Env, const struct Op_Import*);
#endif
const Type ret = get_type(env, op->ret);
const struct Op_Import opi = { lhs, rhs, ret,
op->ck, op->em, (uintptr_t)f, gwi->loc, op->op };
- return env_add_op(env, &opi);
+ return add_op(gwi->gwion, &opi);
}
unload_context(ctx, env);
return ret;
}
-
-ANN m_bool env_add_op(const Env env, const struct Op_Import* opi) {
- if(!env->curr->info->op_map.ptr)
- map_init(&env->curr->info->op_map);
- return add_op(env->gwion, opi);
-}
struct OpChecker ock = { gwion->env, &n->info->op_map, opi, 0 };
CHECK_BB(op_exist(&ock, n))
} while((n = n->parent));
+ if(!gwion->env->curr->info->op_map.ptr)
+ map_init(&gwion->env->curr->info->op_map);
struct OpChecker ock = { gwion->env, &gwion->env->curr->info->op_map, opi, 0 };
const Vector v = op_vector(gwion->mp, &ock);
const M_Operator* mo = new_mo(gwion->mp, opi);
const Type r = GET_FLAG(f, unary) ? f->base->args->var_decl->value->type :
f->base->args->next ? f->base->args->next->var_decl->value->type : NULL;
struct Op_Import opi = { .op=op, .lhs=l, .rhs=r, .ret=f->base->ret_type, .pos=f->pos };
- CHECK_BB(env_add_op(env, &opi))
+ CHECK_BB(add_op(env->gwion, &opi))
return GW_OK;
}