Type_Decl* td = new_type_decl(env->gwion->mp, id);
const m_str tl_name = get_type_name(env, s, 1);
if(tl_name) {
- if(!(td->types = str2tl(env, tl_name, pos)) || !type_decl_resolve(env, td)) {
+ if(!(td->types = str2tl(env, tl_name, pos))) {
free_type_decl(env->gwion->mp, td);
return NULL;
}
ck->exp = (ck->exp->next = exp);
else
ck->base = ck->exp = exp;
- ++ck->depth;
++ck->is_exp;
}
const m_bool is_end = ck->str[i + 1] == '\0';
if(!is_end && ck->str[i + 1] != '[')
break;
+ ck->str += i + 1;
+ ++ck->depth;
if(i) {
if(ck->is_exp == GW_ERROR)
ENV_ERR_B(ck->pos, _("subscript must be empty"))
const m_uint num = strtol(tmp, NULL, 10);// migth use &endptr and check errno
const Exp exp = new_exp_prim_int(env->gwion->mp, num, loc_cpy(env->gwion->mp, ck->pos));
array_add_exp(ck, exp);
- ck->str += i + 2;
- return is_end ? GW_OK : array_check(env, ck);
} else {
- if(ck->is_exp)
+ if(ck->is_exp > 0)
break;
- ++ck->depth;
- return array_check(env, ck);
}
+ return is_end ? GW_OK : array_check(env, ck);
}
if(isdigit(c))
tmp[i] = c;
str[tmp_sz] = '\0';
DECL_OO(const ID_List, type_path, = path_valid(gwi->gwion->env, str, gwi->loc))
Type_Decl* td = new_type_decl(gwi->gwion->mp, type_path);
- if(subscript && (td->array = import_array_sub(gwi, subscript, is_exp))) {
+ if(subscript && !(td->array = import_array_sub(gwi, subscript, is_exp))) {
free_type_decl(gwi->gwion->mp, td);
return NULL;
}