-Subproject commit 80bf35b35aebe23fc18ebc57b5db627ba26a0167
+Subproject commit 39ad675551cd32f3ad2125f3cf9afe6ac416c99e
ANN static inline Symbol _str2sym(const Gwi gwi, struct td_checker *tdc, const m_str path) {
const Symbol sym = __str2sym(gwi, tdc);
- if(*tdc->str)
+ if(*tdc->str && *tdc->str != '<')
GWI_ERR_O(_("illegal character '%c' in path '%s'."), *tdc->str, path)
return sym;
}
ANN m_bool check_typename_def(const Gwi gwi, ImportCK *ck) {
struct td_checker tdc = { .str= ck->name };
+ if(!(ck->sym = _str2sym(gwi, &tdc, tdc.str)))
+ return GW_ERROR;
ID_List il = __tmpl_list(gwi, &tdc);
if(il == (ID_List)GW_ERROR)
return GW_ERROR;
- if(!(ck->sym = _str2sym(gwi, &tdc, tdc.str))) {
- if(il)
- free_id_list(gwi->gwion->mp, il);
- return GW_ERROR;
- }
ck->tmpl = il;
ck->name = s_name(ck->sym);
return GW_OK;
return new_type_list(gwi->gwion->mp, td, next);
}
-ANN Type_List td_tmpl(const Gwi gwi, struct td_checker *tdc) {
+ANN static Type_List td_tmpl(const Gwi gwi, struct td_checker *tdc) {
if(*tdc->str != '<')
return NULL; // GW_PASS
++tdc->str;
ANN Type_Decl* _str2decl(const Gwi gwi, struct td_checker *tdc) {
+ DECL_OO(const Symbol, sym, = __str2sym(gwi, tdc))
+ struct AC ac = { .str = tdc->str };
+ CHECK_BO(ac_run(gwi, &ac))
+ tdc->str = ac.str;
Type_List tl = td_tmpl(gwi, tdc);
if(tl == (Type_List)GW_ERROR)
return NULL;
Type_Decl *next = NULL;
- const Symbol sym = __str2sym(gwi, tdc);
- if(!sym) {
- if(tl)
- free_type_list(gwi->gwion->mp, tl);
- return NULL;
- }
- struct AC ac = { .str = tdc->str };
- if(ac_run(gwi, &ac) < 0) {
- if(tl)free_type_list(gwi->gwion->mp, tl);
- return NULL;
- }
- tdc->str = ac.str;
if(*tdc->str == '.') {
++tdc->str;
if(!(next = _str2decl(gwi, tdc))) {
GWI_BB(gwi_oper_ini(gwi, "@Ptr", NULL, NULL))
GWI_BB(gwi_oper_add(gwi, opck_ptr_scan))
GWI_BB(gwi_oper_end(gwi, "@scan", NULL))
- const Type t_ptr = gwi_class_ini(gwi, "<~A~>Ptr", "@Ptr");
-// const Type t_ptr = gwi_class_ini(gwi, "<~A~>Ptr", NULL);
+ const Type t_ptr = gwi_class_ini(gwi, "Ptr<~A~>", "@Ptr");
gwi->gwion->type[et_ptr] = t_ptr;
GWI_BB(gwi_item_ini(gwi, "@internal", "@val"))
GWI_BB(gwi_item_end(gwi, 0, NULL))
GWI_BB(gwi_class_end(gwi))
SET_FLAG((t_fork), abstract);
- const Type t_typed = gwi_class_ini(gwi, "<~A~>TypedFork", "Fork");
+ const Type t_typed = gwi_class_ini(gwi, "TypedFork<~A~>", "Fork");
gwi_item_ini(gwi, "A", "retval");
GWI_BB((gwi_item_end(gwi, ae_flag_const, NULL)))
GWI_BB(gwi_class_end(gwi))
#define MAP_VAL(a) *((M_Object*)(a->data + o_map_value))
GWION_IMPORT(class_template) {
- GWI_OB(gwi_class_ini(gwi, "<~A,B~>ClassTemplate", NULL))
+ GWI_OB(gwi_class_ini(gwi, "ClassTemplate<~A,B~>", NULL))
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_func_ini(gwi, "int", "<~C,D~>test"))
+ GWI_BB(gwi_func_ini(gwi, "int", "test<~C,D~>"))
GWI_BB(gwi_func_end(gwi, (f_xfun)1, ae_flag_none))
GWI_BB(gwi_class_end(gwi))
- GWI_BB(gwi_item_ini(gwi, "<~Ptr<~int~>,int[]~>ClassTemplate", "testObject"))
+ GWI_BB(gwi_item_ini(gwi, "ClassTemplate<~<~int~>Ptr,int[]~>", "testObject"))
GWI_BB(gwi_item_end(gwi, ae_flag_none, NULL))
return GW_OK;
}
GWION_IMPORT(typedef_test) {
Type t_func_typedef;
GWI_OB((t_func_typedef = gwi_mk_type(gwi, "FuncTypedef", SZ_INT , NULL)))
- GWI_BB(gwi_fptr_ini(gwi, "int", "<~A~>test"))
+ GWI_BB(gwi_fptr_ini(gwi, "int", "test<~test~>"))
GWI_OB(gwi_fptr_end(gwi, 0))
return GW_OK;
}
#include "import.h"
GWION_IMPORT(typedef_test) {
- GWI_BB(gwi_fptr_ini(gwi, "int~", "<~A~>test"))
+ GWI_BB(gwi_fptr_ini(gwi, "int~", "test<~A~>"))
GWI_OB(gwi_fptr_end(gwi, 0))
return GW_OK;
}
#include "instr.h"
GWION_IMPORT(too_many_args) {
- GWI_BB(gwi_func_ini(gwi, "<~int~>Ptr", "<~A~>test"))
+ GWI_BB(gwi_func_ini(gwi, "Ptr<~int~>", "test<~A~>"))
GWI_BB(gwi_func_ini(gwi, "int", "test"))
GWI_BB(gwi_func_arg(gwi, "int", "i[][]"))
GWI_BB(gwi_func_end(gwi, (f_xfun)1, ae_flag_none))
#include "instr.h"
GWION_IMPORT(too_many_args) {
- GWI_BB(gwi_func_ini(gwi, "<~int~>Ptr", "<~A~>test"))
+ GWI_BB(gwi_func_ini(gwi, "Ptr<~int~>", "test<~A~>"))
GWI_BB(gwi_func_arg(gwi, "int", "i[][]"))
GWI_BB(gwi_item_end(gwi, ae_flag_none, NULL))
return GW_OK;
}
GWION_IMPORT(func_tmpl) {
- GWI_BB(gwi_func_ini(gwi, "int[]", "<~A~>test"))
+ GWI_BB(gwi_func_ini(gwi, "int[]", "test<~A~>"))
GWI_BB(gwi_func_arg(gwi, "A", "i"))
GWI_BB(gwi_func_end(gwi, func_tmpl_xfun, ae_flag_none))
return GW_OK;
}
GWION_IMPORT(func_tmpl) {
- GWI_BB(gwi_func_ini(gwi, "voit", "<~A~>test"))
+ GWI_BB(gwi_func_ini(gwi, "voit", "test<~A~>"))
GWI_BB(gwi_func_end(gwi, func_tmpl_xfun, ae_flag_none))
return GW_OK;
}
const Type t2 = gwi_mk_type(gwi, "T<a>", SZ_INT, NULL);
gwi_add_type(gwi, t2);
- const Type t3 = gwi_mk_type(gwi, "<~a~>T", SZ_INT, NULL);
+ const Type t3 = gwi_mk_type(gwi, "T<~a~>", SZ_INT, NULL);
gwi_add_type(gwi, t3);
return GW_OK;
#include "gwi.h"
GWION_IMPORT(trig) {
- DECL_OB(const Type, t0, = gwi_mk_type(gwi, "<~a~>T", SZ_INT, NULL))
+ DECL_OB(const Type, t0, = gwi_mk_type(gwi, "T<~a~>", SZ_INT, NULL))
return gwi_add_type(gwi, t0);
}
#! [contains] already imported
-<<<1 >>>;
+<<< 1 >>>;
#include "import.h"
GWION_IMPORT(typedef_test) {
- GWI_BB(gwi_typedef_ini(gwi, "int", "<~A~>Typedef"))
- GWI_BB(gwi_typedef_ini(gwi, "int", "<~A~>Typedef"))
+ GWI_BB(gwi_typedef_ini(gwi, "int", "Typedef<~A~>"))
+ GWI_BB(gwi_typedef_ini(gwi, "int", "Typedef<~A~>"))
return GW_OK;
}
#include "import.h"
GWION_IMPORT(typedef_test) {
- GWI_BB(gwi_typedef_ini(gwi, "<~A~>Ptr", "<~A~>Typedef"))
+ GWI_BB(gwi_typedef_ini(gwi, "Ptr<~A~>", "Typedef<~A~>"))
GWI_OB(gwi_typedef_end(gwi, ae_flag_none))
return GW_OK;
}
#include "import.h"
GWION_IMPORT(union_test) {
- GWI_BB(gwi_union_ini(gwi, "<~A~>U", NULL))
+ GWI_BB(gwi_union_ini(gwi, "U<~A~>", NULL))
GWI_BB(gwi_union_add(gwi,"float", "f"))
GWI_BB(gwi_union_add(gwi,"int", "i"))
GWI_BB(gwi_union_add(gwi,"A", "a"))
#include "import.h"
GWION_IMPORT(union_test) {
- GWI_BB(gwi_union_ini(gwi, "<~A~>U", "My"))
+ GWI_BB(gwi_union_ini(gwi, "U<~A~>", "My"))
GWI_BB(gwi_union_add(gwi,"float", "f"))
GWI_BB(gwi_union_add(gwi,"int", "i"))
GWI_BB(gwi_union_add(gwi,"A", "a"))
#include "import.h"
GWION_IMPORT(union_test) {
- GWI_BB(gwi_union_ini(gwi, "<~A~>U", NULL))
+ GWI_BB(gwi_union_ini(gwi, "U<~A~>", NULL))
GWI_BB(gwi_union_add(gwi,"float", "f"))
GWI_BB(gwi_union_add(gwi,"int", "i"))
GWI_BB(gwi_union_add(gwi,"A", "a"))
- GWI_BB(gwi_union_ini(gwi, "<~A~>U", NULL))
+ GWI_BB(gwi_union_ini(gwi, "U<~A~>", NULL))
GWI_OB(gwi_union_end(gwi, 0))
return GW_OK;
}
#include "import.h"
GWION_IMPORT(union_test) {
- GWI_BB(gwi_union_ini(gwi, "<~A~>U", "Test"))
+ GWI_BB(gwi_union_ini(gwi, "U<~A~>", "Test"))
GWI_BB(gwi_union_add(gwi,"float", "f"))
GWI_BB(gwi_union_add(gwi,"int", "i"))
GWI_BB(gwi_union_add(gwi,"A", "a"))