-Subproject commit 1b0fc5136209bc7ab709ad88c803a7819cf704c5
+Subproject commit c296c9b96cd54440f1dbaf7073c92ed62f82f298
ANN static inline m_uint captures_sz(const Capture_List captures) {
const Capture *cap = mp_vector_at(captures, Capture, (captures->len - 1));
- return cap->new->from->offset + cap->new->type->size;
+ return cap->temp->from->offset + cap->temp->type->size;
}
#endif
#ifndef __NSPC
#define __NSPC
-struct NspcInfo_ {
+typedef struct NspcInfo_ {
struct Map_ op_map;
Scope value;
Scope type;
Scope func;
Scope trait;
struct Vector_ op_tmpl;
-};
+} NspcInfo;
struct Nspc_ {
struct Vector_ vtable;
struct VM_Code_ * dtor;
Nspc parent;
m_str name;
- struct NspcInfo_ *info;
+ NspcInfo *info;
uint16_t offset;
uint16_t ref;
uint16_t class_data_size;
ANN static void clean_captures(Clean *a, Capture_List b) {
for(uint32_t i = 0; i < b->len; i++) {
const Capture *cap = mp_vector_at(b, Capture, i);
- if(cap->new) value_remref(cap->new, a->gwion);
+ if(cap->temp) value_remref(cap->temp, a->gwion);
}
}
}
ANN Type_Decl *str2td(const Gwion gwion, const m_str str, const loc_t pos) {
+puts(str);
struct td_checker tdc = {.str = str, .pos = pos};
DECL_OO(Type_Decl *, td, = _str2td(gwion, &tdc));
- if (*tdc.str) {
+//*(m_uint*)0 = 1;
+ if(*tdc.str) {
+ Type_Decl *tmp = td;
+ while(tmp->next) tmp = tmp->next;
+ while(!strcmp(tdc.str, "[]")) {
+ tdc.str += 2;
+ if(!td->array) td->array = new_array_sub(gwion->mp, NULL);
+ else td->array->depth++;
+ return td;
+ }
free_type_decl(gwion->mp, td);
GWION_ERR_O(pos, "excedental character '%c' in '%s'", *tdc.str, str);
}
const Type owner = t->info->value->from->owner_class;
if (owner) {
td_fullname(gwion->env, &text, owner);
+printf("%s %s\n", text.str, t->name);
text_add(&text, ".");
}
text_add(&text, t->name);
const loc_t pos NUSED) {
struct td_info info = {.tl = tl, {.mp = gwion->mp}};
CHECK_BO(td_info_run(gwion->env, &info));
+printf("=== %s ===\n", info.text.str);
return info.text.str;
}
def->base->tmpl->call = cpy_type_list(env->gwion->mp, dt->tl);
def->base->tmpl->base = dt->base->base->tmpl->base;
dt->def = def;
+printf("%s %p\n", v->from->owner->name, v->from->owner_class);
+printf("%p %p\n", v->from->owner->parent, v->from->owner);
+printf("%p %p\n", v->from->owner->parent->parent, v->from->owner);
dt->owner = v->from->owner;
dt->owner_class = v->from->owner_class;
return def;
for(uint32_t i = 0; i < unary->captures->len; i++) {
Capture *const cap = mp_vector_at(unary->captures, Capture, i);
DECL_OO(const Type, t, = upvalue_type(env, cap));
- cap->new = new_value(env, t, s_name(cap->xid), cap->pos);
- cap->new->from->offset = offset;
- offset += cap->new->type->size;
+ cap->temp = new_value(env, t, s_name(cap->xid), cap->pos);
+ cap->temp->from->offset = offset;
+ offset += cap->temp->type->size;
}
}
Upvalues upvalues = { .values = env->curr->info->value };
if(unary->captures) {
for(uint32_t i = 0; i < unary->captures->len; i++) {
Capture *const cap = mp_vector_at(unary->captures, Capture, i);
- valid_value(env, cap->xid, cap->new);
+ valid_value(env, cap->xid, cap->temp);
}
}
const Func f = env->func;
ANN static ssize_t template_size(const Env env, struct tmpl_info *info) {
DECL_OB(const m_str, str,
= tl2str(env->gwion, info->td->types, info->td->pos));
+printf("ùù %s ùù\n", str);
const size_t tmpl_sz = tmpl_set(info, str);
+puts("jeje");
const m_str base = type2str(env->gwion, info->base, info->td->pos);
+printf("mm %s mm\n", str);
return tmpl_sz + tmpl_set(info, base) + 4;
// return tmpl_sz + tmpl_set(info, info->base->name) + 4;
}
if(!GET_FLAG(t, global) && !from_global_nspc(env, from->owner)) {
if(from->owner_class && type_global(env, from->owner_class))
return true;
+puts(t->name);
gwerr_basic("can't use non-global type in a global class", NULL, NULL, env->name, pos, 0);
gwerr_secondary("not declared global", from->filename, from->loc);
const struct ValueFrom_ *ownerFrom = env->class_def->info->value->from;
static ANN Type scan_func(const Env env, const Type t, const Type_Decl *td) {
DECL_OO(const m_str, tl_name, = tl2str(env->gwion, td->types, td->pos));
+printf("||| %s ||| \n", tl_name);
const Symbol sym = func_symbol(env, t->info->value->from->owner->name,
t->info->func->name, tl_name, 0);
free_mstr(env->gwion->mp, tl_name);