ANN static Type_Decl *str2td_fptr(const Gwion gwion, struct td_checker *tdc) {
const m_str base = tdc->str;
tdc->str++;
- Type_Decl *const ret_td = _str2td(gwion, tdc);
+ DECL_O(Type_Decl *const, ret_td, = _str2td(gwion, tdc));
const TmplArg_List tl = td_tmpl(gwion, tdc);
if (tl == TMPLARG_ERROR) {
free_type_decl(gwion->mp, ret_td);
}
ANN bool gwi_run(const Gwion gwion, bool (*f)(const Gwi)) {
- const m_str name = gwion->env->name;
- // const Context ctx = gwion->env->context;
- // gwion->env->context = NULL;
OperCK oper = {};
struct Gwi_ gwi = {.gwion = gwion, .oper = &oper};
const bool ret = !gwion->data->cdoc ? f(&gwi) : run_with_doc(&gwi, f);
if (!ret) gwi_reset(&gwi);
- gwion->env->name = name;
- // gwion->env->context = ctx;
return ret;
}
ANN static Type _get_type(const Gwi gwi, const m_str s) {
if (s == (m_str)OP_ANY_TYPE) return OP_ANY_TYPE;
- // str2type
- Type_Decl *td = gwi_str2td(gwi, s);
- const Type t = known_type(gwi->gwion->env, td);
- free_type_decl(gwi->gwion->mp, td);
- return t;
+ return str2type(gwi->gwion, s, gwi->loc);
}
ANN2(1) static inline Type gwi_get_type(const Gwi gwi, const m_str str) {
// or better, some function with envset and traverse
const m_uint scope = env_push_nspc(env, opi.nspc);
// we assume succes here
- /*const bool ret = */ traverse_func_def(env, def);
+ const bool ret = traverse_func_def(env, def);
env_pop(env, scope);
+ if(!ret) return NULL;
def->base->func->value_ref->type->info->parent = env->gwion->type[et_op];
impl->e->type = def->base->func->value_ref->type;
impl->e->d.prim.value = def->base->func->value_ref;