ANN Type_List str2tl(const Env env, const m_str s, const loc_t pos) {
struct GetTl gtl = { .str=s, .sz = strlen(s) };
for(m_uint i = 0; i < gtl.sz; ++i) {
- if(s[i] == '<' && !gtl.lvl)
+ if(s[i] == '<')
CHECK_BO(tl_open(>l, ++i))
- if(s[i] == '~' && !gtl.lvl)
+ else if(s[i] == '~')
CHECK_BO(tl_close(>l, ++i))
- if(s[i] == ',' && !gtl.lvl)
+ else if(s[i] == ',' && !gtl.lvl)
return tlnext(env, s, i, pos);
}
return _str2tl(env, s, pos);
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, type_name, pos)) || !type_decl_resolve(env, td)) {
+ if(!(td->types = str2tl(env, tl_name, pos)) || !type_decl_resolve(env, td)) {
free_type_decl(env->gwion->mp, td);
return NULL;
}
GWI_OB((t_class_template = gwi_mk_type(gwi, "ClassTemplate", SZ_INT, "Object")))
GWI_BB(gwi_class_ini(gwi, t_class_template, class_template_ctor, NULL))
gwi_tmpl_end(gwi);
- GWI_BB(gwi_item_ini(gwi, "A[]", "key"))
+ GWI_BB(gwi_item_ini(gwi, "A[]", "key"))
GWI_BB((o_map_key = gwi_item_end(gwi, ae_flag_member | ae_flag_template, NULL)))
GWI_BB(gwi_item_ini(gwi, "B[]", "value"))
GWI_BB((o_map_value = gwi_item_end(gwi, ae_flag_member, NULL)))
GWI_BB(gwi_class_end(gwi))
- GWI_BB(gwi_item_ini(gwi, "ClassTemplate<~Ptr<~int~>,int~>", "testObject"))
+ GWI_BB(gwi_item_ini(gwi, "ClassTemplate<~Ptr<~int~>,int[]~>", "testObject"))
GWI_BB(gwi_item_end(gwi, ae_flag_none, NULL))
return GW_OK;
}