ANN m_bool already_defined(const Env env, const Symbol s, const loc_t pos);
ANN m_bool type_engine_check_prog(const Env, const Ast);
ANN m_bool traverse_func_template(const Env, const Func_Def);
-ANN ID_List str2list(const Env, const m_str path, m_uint* array_depth);
+ANN ID_List str2list(const Env, const m_str path, m_uint* array_depth, const loc_t);
ANN2(1,3) void env_err(const Env, const struct YYLTYPE *pos, const m_str fmt, ...);
#endif
#define OP_CHECK(a) ANN Type a(const Env env NUSED, void* data NUSED, m_bool* mut NUSED)
#define OP_EMIT(a) ANN Instr a(const Emitter emit NUSED, void* data NUSED)
#ifdef GWION_BUILTIN
-#define GWI_BB(a) (void)(a);
-#define GWI_OB(a) (void)(a);
+#define GWI_BB(a) { gwi_set_loc(gwi, __FILE__, __LINE__); (void)(a); }
+#define GWI_OB(a) { gwi_set_loc(gwi, __FILE__, __LINE__); (void)(a); }
#define GWION_IMPORT(a) ANN m_bool import_##a(const Gwi gwi)
#else
-#define GWI_BB(a) CHECK_BB(a)
-#define GWI_OB(a) CHECK_OB(a)
+#define GWI_BB(a) { gwi_set_loc(gwi, __FILE__, __LINE__); CHECK_BB(a) }
+#define GWI_OB(a) { gwi_set_loc(gwi, __FILE__, __LINE__); CHECK_OB(a) }
#define GWION_IMPORT(a) ANN m_bool import(const Gwi gwi)
#endif
#define ALLOC_PTR(p, a, b, c) b* a = (b*)_mp_calloc(p, sizeof(b)); *a = (b)c
ANN m_int gwi_oper_emi(const Gwi gwi, const opem);
ANN2(1) m_int gwi_oper_end(const Gwi gwi, const m_str op, const f_instr f);
ANN m_int gwi_oper_cond(const Gwi, const m_str, const f_instr, const f_instr);
-ANN Type_Decl* str2decl(const Env, const m_str, m_uint* depth);
+ANN Type_Decl* str2decl(const Env, const m_str, m_uint* depth, const loc_t);
OP_CHECK(opck_const_rhs);
OP_CHECK(opck_unary_meta);
OP_EMIT(opem_basic_cast);
OP_EMIT(opem_new);
-ANN Type_List str2tl(const Env env, const m_str s, m_uint *depth);
+ANN Type_List str2tl(const Env env, const m_str s, m_uint *depth, const loc_t);
#define FREEARG(a) ANN void a(Instr instr NUSED, void *gwion NUSED)
typedef void (*f_freearg)(Instr, void*);
ANN void gwi_reserve(const Gwi, const m_str);
typedef struct SpecialId_* SpecialId;
ANN void gwi_specialid(const Gwi gwi, const m_str id, const SpecialId);
+ANN void gwi_set_loc(const Gwi, const m_str, const uint);
#endif
return GW_ERROR;
}
-ANN static Type_List tmpl_tl(const Env env, const m_str name) {
+ANN static Type_List tmpl_tl(const Env env, const m_str name, const loc_t pos) {
const m_str start = strchr(name, '<');
const m_str end = strchr(name, '@');
char c[strlen(name)];
strcpy(c, start + 2);
c[strlen(start) - strlen(end) - 4] = '\0';
m_uint depth;
- return str2tl(env, c, &depth);
+ return str2tl(env, c, &depth, pos);
}
ANN static inline m_bool traverse_emit_func_def(const Emitter emit, const Func_Def fdef) {
struct dottmpl_ *dt = mp_calloc(emit->gwion->mp, dottmpl);
dt->name = s_name(insert_symbol(c));
dt->vt_index = f->def->base->tmpl->base;
- dt->tl = tmpl_tl(emit->env, c);
+ dt->tl = tmpl_tl(emit->env, c, td_pos(f->def->base->td));
dt->base = f->def;
instr->opcode = eOP_MAX;
instr->m_val = (m_uint)dt;
char c[sz + 1];
memcpy(c, f->name, sz);
c[sz] = '\0';
- dt->tl = tmpl_tl(emit->env, c);
+ dt->tl = tmpl_tl(emit->env, c, td_pos(f->def->base->td));
dt->name = s_name(insert_symbol(c));
dt->vt_index = f->def->base->tmpl->base;
dt->base = f->def;
ANN void env_err(const Env env, const struct YYLTYPE* pos, const m_str fmt, ...) {
if(env->context && env->context->error)
- return;
+ return;
if(env->class_def)
gw_err(_("in class: '%s'\n"), env->class_def->name);
if(env->func)
const Type t_class = gwi_mk_type(gwi, "@Class", SZ_INT, NULL);
gwi->gwion->type[et_class] = t_class;
GWI_BB(gwi_add_type(gwi, t_class))
- CHECK_BB(gwi_gack(gwi, gwi->gwion->type[et_class], gack_class)) // not working yet
+ GWI_BB(gwi_gack(gwi, gwi->gwion->type[et_class], gack_class)) // not working yet
gwi->gwion->type[et_class] = t_class;
const Type t_undefined = gwi_mk_type(gwi, "@Undefined", SZ_INT, NULL);
GWI_BB(gwi_set_global_type(gwi, t_undefined, et_undefined))
GWI_BB(gwi_set_global_type(gwi, t_auto, et_auto))
SET_FLAG(t_class, abstract);
const Type t_void = gwi_mk_type(gwi, "void", 0, NULL);
- CHECK_BB(gwi_gack(gwi, t_void, gack_void))
+ GWI_BB(gwi_gack(gwi, t_void, gack_void))
GWI_BB(gwi_set_global_type(gwi, t_void, et_void))
const Type t_null = gwi_mk_type(gwi, "@null", SZ_INT, NULL);
GWI_BB(gwi_set_global_type(gwi, t_null, et_null))
const Type t_gack = gwi_mk_type(gwi, "@Gack", SZ_INT, NULL);
GWI_BB(gwi_set_global_type(gwi, t_gack, et_gack))
const Type t_int = gwi_mk_type(gwi, "int", SZ_INT, NULL);
- CHECK_BB(gwi_gack(gwi, t_int, gack_int))
+ GWI_BB(gwi_gack(gwi, t_int, gack_int))
GWI_BB(gwi_set_global_type(gwi, t_int, et_int))
const Type t_float = gwi_mk_type(gwi, "float", SZ_FLOAT, NULL);
- CHECK_BB(gwi_gack(gwi, t_float, gack_float))
+ GWI_BB(gwi_gack(gwi, t_float, gack_float))
GWI_BB(gwi_set_global_type(gwi, t_float, et_float))
const Type t_dur = gwi_mk_type(gwi, "dur", SZ_FLOAT, NULL);
- CHECK_BB(gwi_gack(gwi, t_dur, gack_float))
+ GWI_BB(gwi_gack(gwi, t_dur, gack_float))
GWI_BB(gwi_add_type(gwi, t_dur))
const Type t_time = gwi_mk_type(gwi, "time", SZ_FLOAT, NULL);
- CHECK_BB(gwi_gack(gwi, t_time, gack_float))
+ GWI_BB(gwi_gack(gwi, t_time, gack_float))
GWI_BB(gwi_add_type(gwi, t_time))
const Type t_now = gwi_mk_type(gwi, "@now", SZ_FLOAT, "time");
GWI_BB(gwi_add_type(gwi, t_now))
gwi_specialid(gwi, "now", &spid);
const Type t_complex = gwi_mk_type(gwi, "complex", SZ_COMPLEX , NULL);
gwi->gwion->type[et_complex] = t_complex;
- CHECK_BB(gwi_gack(gwi, t_complex, gack_complex))
+ GWI_BB(gwi_gack(gwi, t_complex, gack_complex))
const Type t_polar = gwi_mk_type(gwi, "polar", SZ_COMPLEX , NULL);
gwi->gwion->type[et_polar] = t_polar;
- CHECK_BB(gwi_gack(gwi, t_polar, gack_polar))
+ GWI_BB(gwi_gack(gwi, t_polar, gack_polar))
const Type t_vec3 = gwi_mk_type(gwi, "Vec3", SZ_VEC3, NULL);
gwi->gwion->type[et_vec3] = t_vec3;
- CHECK_BB(gwi_gack(gwi, t_vec3, gack_vec3))
+ GWI_BB(gwi_gack(gwi, t_vec3, gack_vec3))
const Type t_vec4 = gwi_mk_type(gwi, "Vec4", SZ_VEC4, NULL);
gwi->gwion->type[et_vec4] = t_vec4;
- CHECK_BB(gwi_gack(gwi, t_vec4, gack_vec4))
+ GWI_BB(gwi_gack(gwi, t_vec4, gack_vec4))
GWI_BB(import_object(gwi))
const Type t_union = gwi_mk_type(gwi, "@Union", SZ_INT, "Object");
gwi->gwion->type[et_union] = t_union;
vm->gwion->env->name = "[builtin]";
struct YYLTYPE loc = {};
struct Gwi_ gwi = { .gwion=vm->gwion, .loc=&loc };
- GWI_BB(import_core_libs(&gwi))
+ CHECK_BB(import_core_libs(&gwi))
vm->gwion->env->name = "[imported]";
for(m_uint i = 0; i < vector_size(plug_dirs); ++i) {
m_bool (*import)(Gwi) = (m_bool(*)(Gwi))vector_at(plug_dirs, i);
return GW_OK;
}
-ANN /* static */ ID_List str2list(const Env env, const m_str path, m_uint* array_depth) {
+ANN ID_List str2list(const Env env, const m_str path,
+ m_uint* array_depth, const loc_t pos) {
const m_uint len = strlen(path);
ID_List list = NULL;
m_uint depth = 0;
char curr[len + 1];
- struct Path p = { path, curr, len, { 1,1,1,1} };
+ struct Path p = { path, curr, len, { pos->first_line, pos->first_column, pos->last_line, pos->last_column } };
memset(curr, 0, len + 1);
while(p.len > 2 && path[p.len - 1] == ']' && path[p.len - 2] == '[') {
ANN2(1,2) Type gwi_mk_type(const Gwi gwi NUSED, const m_str name, const m_uint size, const m_str parent_name) {
m_uint depth;
- const Type_Decl* td = parent_name ? str2decl(gwi->gwion->env, parent_name, &depth) : NULL;
+ const Type_Decl* td = parent_name ? str2decl(gwi->gwion->env, parent_name, &depth, gwi->loc) : NULL;
const Type parent = td ? known_type(gwi->gwion->env, td) : NULL;
const Type t = new_type(gwi->gwion->mp, 0, name, parent);
t->size = size;
ANN m_int gwi_item_ini(const Gwi gwi, const restrict m_str type, const restrict m_str name) {
DL_Var* v = &gwi->var;
memset(v, 0, sizeof(DL_Var));
- if(!(v->t.xid = str2list(gwi->gwion->env, type, &v->array_depth)))
+ if(!(v->t.xid = str2list(gwi->gwion->env, type, &v->array_depth, gwi->loc)))
GWI_ERR_B(_(" ... during var import '%s.%s'."), gwi->gwion->env->class_def->name, name)
v->var.xid = insert_symbol(gwi->gwion->st, name);
return GW_OK;
return array_sub;
}
-ANN /*static */ Type_List str2tl(const Env env, const m_str s, m_uint *depth) {
- DECL_OO(Type_Decl*, td, = str2decl(env, s, depth))
+ANN Type_List str2tl(const Env env, const m_str s, m_uint *depth, const loc_t pos) {
+ DECL_OO(Type_Decl*, td, = str2decl(env, s, depth, pos))
td->array = make_dll_arg_list_array(env->gwion->mp, NULL, depth, 0);
return new_type_list(env->gwion->mp, td, NULL);
}
-ANN Type_Decl* str2decl(const Env env, const m_str s, m_uint *depth) {
+ANN Type_Decl* str2decl(const Env env, const m_str s, m_uint *depth, const loc_t pos) {
m_uint i = 0;
DECL_OO(m_str, type_name, = get_type_name(env, s, i++))
- DECL_OO(ID_List, id, = str2list(env, type_name, depth))
+ DECL_OO(ID_List, id, = str2list(env, type_name, depth, pos))
Type_Decl* td = new_type_decl(env->gwion->mp, id);
Type_List tmp = NULL;
if(!td) {
while((type_name = get_type_name(env, s, i++))) {
m_uint d = 0;
if(!tmp)
- td->types = tmp = str2tl(env, type_name, &d);
+ td->types = tmp = str2tl(env, type_name, &d, pos);
else {
- tmp->next = str2tl(env, type_name, &d);
+ tmp->next = str2tl(env, type_name, &d, pos);
tmp = tmp->next;
}
}
Type_Decl* type_decl = NULL;
DL_Value* arg = &dl_fun->args[i-1];
ID_List type_path2;
- if(!(type_decl = str2decl(env, arg->type, &array_depth))) {
+ if(!(type_decl = str2decl(env, arg->type, &array_depth, gwi->loc))) {
if(arg_list)
free_arg_list(env->gwion->mp, arg_list);
GWI_ERR_O(_(" ... at argument '%"UINT_F"'"), i + 1)
}
- if((type_path2 = str2list(env, arg->name, &array_depth2)))
+ if((type_path2 = str2list(env, arg->name, &array_depth2, gwi->loc)))
free_id_list(env->gwion->mp, type_path2);
if(array_depth && array_depth2) {
free_type_decl(env->gwion->mp, type_decl);
ANN Type_Decl* import_td(const Gwi gwi, const m_str name) {
const Env env = gwi->gwion->env;
m_uint array_depth;
- DECL_OO(const ID_List, type_path, = str2list(env, name, &array_depth))
+ DECL_OO(const ID_List, type_path, = str2list(env, name, &array_depth, gwi->loc))
Type_Decl* type_decl = new_type_decl(env->gwion->mp, type_path);
if(!type_decl) {
free_id_list(env->gwion->mp, type_path);
return GW_OK;
}
-static Type get_type(const Env env, const m_str str) {
+ANN2(1,3) static Type get_type(const Env env, const m_str str, const loc_t pos) {
m_uint depth = 0;
- const ID_List list = (str && str != (m_str)OP_ANY_TYPE) ? str2list(env, str, &depth) : NULL;
+ const ID_List list = (str && str != (m_str)OP_ANY_TYPE) ? str2list(env, str, &depth, pos) : NULL;
const Type t = (str == (m_str) OP_ANY_TYPE) ? OP_ANY_TYPE : list ? find_type(env, list) : NULL;
if(list)
free_id_list(env->gwion->mp, list);
ANN2(1,2) static int import_op(const Gwi gwi, const DL_Oper* op,
const f_instr f) {
const Env env = gwi->gwion->env;
- const Type lhs = op->lhs ? get_type(env, op->lhs) : NULL;
- const Type rhs = op->rhs ? get_type(env, op->rhs) : NULL;
- const Type ret = get_type(env, op->ret);
+ const Type lhs = op->lhs ? get_type(env, op->lhs, gwi->loc) : NULL;
+ const Type rhs = op->rhs ? get_type(env, op->rhs, gwi->loc) : NULL;
+ const Type ret = get_type(env, op->ret, gwi->loc);
const struct Op_Import opi = { lhs, rhs, ret,
op->ck, op->em, (uintptr_t)f, gwi->loc, op->op };
return add_op(gwi->gwion, &opi);
m_uint array_depth;
ID_List type_path;
Type_Decl* type_decl = NULL;
- if(!(type_path = str2list(env, dl_fun->type, &array_depth)) ||
+ if(!(type_path = str2list(env, dl_fun->type, &array_depth, gwi->loc)) ||
!(type_decl = new_type_decl(env->gwion->mp, type_path)))
GWI_ERR_O(_(" ... during fptr import '%s' (type)."), dl_fun->name);
const Arg_List args = make_dll_arg_list(gwi, dl_fun);
ID_List id_list;
m_uint array_depth;
Array_Sub array = NULL;
- CHECK_OO((id_list = str2list(env, type, &array_depth)))
+ CHECK_OO((id_list = str2list(env, type, &array_depth, gwi->loc)))
if(array_depth) {
array = new_array_sub(env->gwion->mp, NULL);
array->depth = array_depth;
map_set(&gwi->gwion->data->id, (vtype)insert_symbol(gwi->gwion->st, id), (vtype)a);
gwi_reserve(gwi, id);
}
+
+ANN void gwi_set_loc(const Gwi gwi, const m_str file, const uint line) {
+ gwi->loc->first_line = gwi->loc->last_line = line;
+ gwi->gwion->env->name = file;
+}
ERR_O(td->exp->pos, _("Expression must be of type '%s', not '%s'\n"
"maybe you meant typeof(Expression)"), env->gwion->type[et_class]->name, td->exp->type->name);
m_uint depth;
- td->xid = str2list(env, t->name, &depth);
+ td->xid = str2list(env, t->name, &depth, td->exp->pos);
if(depth) {
Exp base = new_exp_prim_int(env->gwion->mp, 0, new_loc(env->gwion->mp, __LINE__)), e = base;
for(m_uint i = 0; i < depth - 1; ++i)
GWION_IMPORT(array_test) {
Type t_invalid_var_name;
- CHECK_OB((t_invalid_var_name = gwi_mk_type(gwi, "invalid_var_name", SZ_INT, "Object")))
- CHECK_BB(gwi_class_ini(gwi, t_invalid_var_name, NULL, NULL))
- CHECK_BB(gwi_item_ini(gwi, "int[]", "int_array"))
- CHECK_BB(gwi_item_end(gwi, 0, NULL)) // import array var
- CHECK_BB(gwi_func_ini(gwi, "float[][]", "f", test_mfun))
- CHECK_BB(gwi_func_end(gwi, 0))
- CHECK_BB(gwi_func_ini(gwi, "float[][]", "g", test_mfun))
- CHECK_BB(gwi_func_end(gwi, 0))
- CHECK_BB(gwi_class_end(gwi))
+ GWI_OB((t_invalid_var_name = gwi_mk_type(gwi, "invalid_var_name", SZ_INT, "Object")))
+ GWI_BB(gwi_class_ini(gwi, t_invalid_var_name, NULL, NULL))
+ GWI_BB(gwi_item_ini(gwi, "int[]", "int_array"))
+ GWI_BB(gwi_item_end(gwi, 0, NULL)) // import array var
+ GWI_BB(gwi_func_ini(gwi, "float[][]", "f", test_mfun))
+ GWI_BB(gwi_func_end(gwi, 0))
+ GWI_BB(gwi_func_ini(gwi, "float[][]", "g", test_mfun))
+ GWI_BB(gwi_func_end(gwi, 0))
+ GWI_BB(gwi_class_end(gwi))
return GW_OK;
}
MFUN(test_mfun){}
GWION_IMPORT(begin_class) {
Type t_invalid_var_name;
- CHECK_OB((t_invalid_var_name = gwi_mk_type(gwi, "invalid_var_name", SZ_INT, "Object")))
- CHECK_BB(gwi_class_ini(gwi, t_invalid_var_name, NULL, NULL))
- CHECK_BB(gwi_class_ini(gwi, t_invalid_var_name, NULL, NULL))
+ GWI_OB((t_invalid_var_name = gwi_mk_type(gwi, "invalid_var_name", SZ_INT, "Object")))
+ GWI_BB(gwi_class_ini(gwi, t_invalid_var_name, NULL, NULL))
+ GWI_BB(gwi_class_ini(gwi, t_invalid_var_name, NULL, NULL))
return GW_OK;
}
}
GWION_IMPORT(callback) {
- CHECK_BB(gwi_fptr_ini(gwi, "Vec4", "PtrType"))
- CHECK_OB(gwi_fptr_end(gwi, 0))
+ GWI_BB(gwi_fptr_ini(gwi, "Vec4", "PtrType"))
+ GWI_OB(gwi_fptr_end(gwi, 0))
const Type t_callback = gwi_mk_type(gwi, "Callback", SZ_INT, "Object");
- CHECK_BB(gwi_class_ini(gwi, t_callback, NULL, NULL))
- CHECK_BB(gwi_func_ini(gwi, "int", "callback", cb_func))
- CHECK_BB(gwi_func_arg(gwi, "PtrType", "func"))
- CHECK_BB(gwi_func_end(gwi, ae_flag_static))
- CHECK_BB(gwi_class_end(gwi))
+ GWI_BB(gwi_class_ini(gwi, t_callback, NULL, NULL))
+ GWI_BB(gwi_func_ini(gwi, "int", "callback", cb_func))
+ GWI_BB(gwi_func_arg(gwi, "PtrType", "func"))
+ GWI_BB(gwi_func_end(gwi, ae_flag_static))
+ GWI_BB(gwi_class_end(gwi))
return GW_OK;
}
Type t_class_template;
const m_str list[2] = { "A", "B" };
gwi_tmpl_ini(gwi, 2, list);
- CHECK_OB((t_class_template = gwi_mk_type(gwi, "ClassTemplate", SZ_INT, "Object")))
- CHECK_BB(gwi_class_ini(gwi, t_class_template, class_template_ctor, 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);
- CHECK_BB(gwi_item_ini(gwi, "A[]", "key"))
- CHECK_BB((o_map_key = gwi_item_end(gwi, ae_flag_member | ae_flag_template, NULL)))
- CHECK_BB(gwi_item_ini(gwi, "B[]", "value"))
- CHECK_BB((o_map_value = gwi_item_end(gwi, ae_flag_member, 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_func_ini(gwi, "B", "set", class_template_set);*/
/*gwi_func_end(gwi, ae_flag_member);*/
- CHECK_BB(gwi_class_end(gwi))
+ GWI_BB(gwi_class_end(gwi))
return GW_OK;
}
GWION_IMPORT(coverage) {
Type t_coverage;
- CHECK_OB((t_coverage = gwi_mk_type(gwi, "Coverage", SZ_INT, "Object")))
- CHECK_BB(gwi_class_ini(gwi, t_coverage, NULL, NULL))
- CHECK_BB(gwi_func_ini(gwi, "int", "i", coverage_int))
- CHECK_BB(gwi_func_end(gwi, ae_flag_static))
- CHECK_BB(gwi_func_ini(gwi, "float", "f", coverage_float))
- CHECK_BB(gwi_func_end(gwi, ae_flag_static))
- CHECK_BB(gwi_func_ini(gwi, "complex", "c", coverage_complex))
- CHECK_BB(gwi_func_end(gwi, ae_flag_static))
- CHECK_BB(gwi_func_ini(gwi, "Vec3", "v", coverage_vec3))
- CHECK_BB(gwi_func_end(gwi, ae_flag_static))
- CHECK_BB(gwi_func_ini(gwi, "Vec4", "w", coverage_vec4))
- CHECK_BB(gwi_func_end(gwi, ae_flag_static))
+ GWI_OB((t_coverage = gwi_mk_type(gwi, "Coverage", SZ_INT, "Object")))
+ GWI_BB(gwi_class_ini(gwi, t_coverage, NULL, NULL))
+ GWI_BB(gwi_func_ini(gwi, "int", "i", coverage_int))
+ GWI_BB(gwi_func_end(gwi, ae_flag_static))
+ GWI_BB(gwi_func_ini(gwi, "float", "f", coverage_float))
+ GWI_BB(gwi_func_end(gwi, ae_flag_static))
+ GWI_BB(gwi_func_ini(gwi, "complex", "c", coverage_complex))
+ GWI_BB(gwi_func_end(gwi, ae_flag_static))
+ GWI_BB(gwi_func_ini(gwi, "Vec3", "v", coverage_vec3))
+ GWI_BB(gwi_func_end(gwi, ae_flag_static))
+ GWI_BB(gwi_func_ini(gwi, "Vec4", "w", coverage_vec4))
+ GWI_BB(gwi_func_end(gwi, ae_flag_static))
ALLOC_PTR(gwi->gwion->mp, i, m_uint, 5);
- CHECK_BB(gwi_item_ini(gwi,"int", "s_i"))
- CHECK_BB(gwi_item_end(gwi, ae_flag_static, i))
+ GWI_BB(gwi_item_ini(gwi,"int", "s_i"))
+ GWI_BB(gwi_item_end(gwi, ae_flag_static, i))
ALLOC_PTR(gwi->gwion->mp, f, m_float, 2.1);
- CHECK_BB(gwi_item_ini(gwi,"int", "s_f"))
- CHECK_BB(gwi_item_end(gwi, ae_flag_static, (void*)f))
+ GWI_BB(gwi_item_ini(gwi,"int", "s_f"))
+ GWI_BB(gwi_item_end(gwi, ae_flag_static, (void*)f))
const m_complex _c = 2.1 + 2.2*I;
ALLOC_PTR(gwi->gwion->mp, c, m_complex, _c);
- CHECK_BB(gwi_item_ini(gwi,"complex", "s_c"))
- CHECK_BB(gwi_item_end(gwi, ae_flag_static, (void*)c))
+ GWI_BB(gwi_item_ini(gwi,"complex", "s_c"))
+ GWI_BB(gwi_item_end(gwi, ae_flag_static, (void*)c))
const m_vec3 _v = { 2.1, 2.2, 2.3 };
ALLOC_PTR(gwi->gwion->mp, v, m_vec3, _v);
- CHECK_BB(gwi_item_ini(gwi,"Vec3", "s_v"))
- CHECK_BB(gwi_item_end(gwi, ae_flag_static, (void*)v))
+ GWI_BB(gwi_item_ini(gwi,"Vec3", "s_v"))
+ GWI_BB(gwi_item_end(gwi, ae_flag_static, (void*)v))
const m_vec4 _w = { 2.1, 2.2, 2.3, 2.4 };
ALLOC_PTR(gwi->gwion->mp, w, m_vec4, _w);
- CHECK_BB(gwi_item_ini(gwi,"Vec4", "s_w"))
- CHECK_BB(gwi_item_end(gwi, ae_flag_static, (void*)w))
+ GWI_BB(gwi_item_ini(gwi,"Vec4", "s_w"))
+ GWI_BB(gwi_item_end(gwi, ae_flag_static, (void*)w))
ALLOC_PTR(gwi->gwion->mp, ci, m_uint, 5);
- CHECK_BB(gwi_item_ini(gwi,"int", "sc_i"))
- CHECK_BB(gwi_item_end(gwi, ae_flag_static | ae_flag_const, ci))
+ GWI_BB(gwi_item_ini(gwi,"int", "sc_i"))
+ GWI_BB(gwi_item_end(gwi, ae_flag_static | ae_flag_const, ci))
ALLOC_PTR(gwi->gwion->mp, cf, m_float, 2.1);
- CHECK_BB(gwi_item_ini(gwi,"float", "sc_f"))
- CHECK_BB(gwi_item_end(gwi, ae_flag_static | ae_flag_const, (void*)cf))
+ GWI_BB(gwi_item_ini(gwi,"float", "sc_f"))
+ GWI_BB(gwi_item_end(gwi, ae_flag_static | ae_flag_const, (void*)cf))
const m_complex _cc = 2.1 + 2.2*I;
ALLOC_PTR(gwi->gwion->mp, cc, m_complex, _cc);
- CHECK_BB(gwi_item_ini(gwi,"complex", "sc_c"))
- CHECK_BB(gwi_item_end(gwi, ae_flag_static | ae_flag_const, (void*)cc))
+ GWI_BB(gwi_item_ini(gwi,"complex", "sc_c"))
+ GWI_BB(gwi_item_end(gwi, ae_flag_static | ae_flag_const, (void*)cc))
const m_vec3 _cv = { 2.1, 2.2, 2.3 };
ALLOC_PTR(gwi->gwion->mp, cv, m_vec3, _cv);
- CHECK_BB(gwi_item_ini(gwi,"Vec3", "sc_v"))
- CHECK_BB(gwi_item_end(gwi, ae_flag_static | ae_flag_const, (void*)cv))
+ GWI_BB(gwi_item_ini(gwi,"Vec3", "sc_v"))
+ GWI_BB(gwi_item_end(gwi, ae_flag_static | ae_flag_const, (void*)cv))
const m_vec4 _cw = { 2.1, 2.2, 2.3, 2.4 };
ALLOC_PTR(gwi->gwion->mp, cw, m_vec4, _cw);
- CHECK_BB(gwi_item_ini(gwi,"Vec4", "sc_w"))
- CHECK_BB(gwi_item_end(gwi, ae_flag_static | ae_flag_const, (void*)cw))
+ GWI_BB(gwi_item_ini(gwi,"Vec4", "sc_w"))
+ GWI_BB(gwi_item_end(gwi, ae_flag_static | ae_flag_const, (void*)cw))
- CHECK_BB(gwi_class_end(gwi))
+ GWI_BB(gwi_class_end(gwi))
return GW_OK;
}
#include "import.h"
GWION_IMPORT(empty_union_test) {
- CHECK_BB(gwi_union_ini(gwi, NULL))
- CHECK_OB(gwi_union_end(gwi, 0))
+ GWI_BB(gwi_union_ini(gwi, NULL))
+ GWI_OB(gwi_union_end(gwi, 0))
return GW_OK;
}
MFUN(test_mfun){}
GWION_IMPORT(end_class) {
- CHECK_BB(gwi_class_end(gwi))
+ GWI_BB(gwi_class_end(gwi))
return GW_OK;
}
#include "import.h"
GWION_IMPORT(enum_test) {
- CHECK_BB(gwi_enum_ini(gwi, NULL))
- CHECK_BB(gwi_enum_add(gwi, "ENUM0", 0))
- CHECK_BB(gwi_enum_add(gwi, "ENUM1", 1))
- CHECK_BB(gwi_enum_add(gwi, "ENUM2", 2))
- CHECK_BB(gwi_enum_add(gwi, "ENUM3", 3))
- CHECK_BB(gwi_enum_add(gwi, "ENUM4", 4))
- CHECK_BB(gwi_enum_add(gwi, "ENUM5", 5))
- CHECK_BB(gwi_enum_add(gwi, "ENUM6", 6))
- CHECK_BB(gwi_enum_add(gwi, "ENUM7", 7))
- CHECK_BB(gwi_enum_add(gwi, "ENUM8", 8))
- CHECK_BB(gwi_enum_add(gwi, "ENUM9", 9))
- CHECK_OB(gwi_enum_end(gwi))
+ GWI_BB(gwi_enum_ini(gwi, NULL))
+ GWI_BB(gwi_enum_add(gwi, "ENUM0", 0))
+ GWI_BB(gwi_enum_add(gwi, "ENUM1", 1))
+ GWI_BB(gwi_enum_add(gwi, "ENUM2", 2))
+ GWI_BB(gwi_enum_add(gwi, "ENUM3", 3))
+ GWI_BB(gwi_enum_add(gwi, "ENUM4", 4))
+ GWI_BB(gwi_enum_add(gwi, "ENUM5", 5))
+ GWI_BB(gwi_enum_add(gwi, "ENUM6", 6))
+ GWI_BB(gwi_enum_add(gwi, "ENUM7", 7))
+ GWI_BB(gwi_enum_add(gwi, "ENUM8", 8))
+ GWI_BB(gwi_enum_add(gwi, "ENUM9", 9))
+ GWI_OB(gwi_enum_end(gwi))
- CHECK_BB(gwi_enum_ini(gwi, "test"))
- CHECK_BB(gwi_enum_add(gwi, "TYPED_ENUM0", 0))
- CHECK_BB(gwi_enum_add(gwi, "TYPED_ENUM1", 1))
- CHECK_BB(gwi_enum_add(gwi, "TYPED_ENUM2", 2))
- CHECK_BB(gwi_enum_add(gwi, "TYPED_ENUM3", 3))
- CHECK_BB(gwi_enum_add(gwi, "TYPED_ENUM4", 4))
- CHECK_BB(gwi_enum_add(gwi, "TYPED_ENUM5", 5))
- CHECK_BB(gwi_enum_add(gwi, "TYPED_ENUM6", 6))
- CHECK_BB(gwi_enum_add(gwi, "TYPED_ENUM7", 7))
- CHECK_BB(gwi_enum_add(gwi, "TYPED_ENUM8", 8))
- CHECK_BB(gwi_enum_add(gwi, "TYPED_ENUM9", 9))
- CHECK_OB(gwi_enum_end(gwi))
+ GWI_BB(gwi_enum_ini(gwi, "test"))
+ GWI_BB(gwi_enum_add(gwi, "TYPED_ENUM0", 0))
+ GWI_BB(gwi_enum_add(gwi, "TYPED_ENUM1", 1))
+ GWI_BB(gwi_enum_add(gwi, "TYPED_ENUM2", 2))
+ GWI_BB(gwi_enum_add(gwi, "TYPED_ENUM3", 3))
+ GWI_BB(gwi_enum_add(gwi, "TYPED_ENUM4", 4))
+ GWI_BB(gwi_enum_add(gwi, "TYPED_ENUM5", 5))
+ GWI_BB(gwi_enum_add(gwi, "TYPED_ENUM6", 6))
+ GWI_BB(gwi_enum_add(gwi, "TYPED_ENUM7", 7))
+ GWI_BB(gwi_enum_add(gwi, "TYPED_ENUM8", 8))
+ GWI_BB(gwi_enum_add(gwi, "TYPED_ENUM9", 9))
+ GWI_OB(gwi_enum_end(gwi))
Type t_enum;
- CHECK_OB((t_enum = gwi_mk_type(gwi, "Enum", 0, NULL)))
- CHECK_BB(gwi_class_ini(gwi, t_enum, NULL, NULL))
- CHECK_BB(gwi_enum_ini(gwi, 0))
- CHECK_BB(gwi_enum_add(gwi, "ENUM0", 0))
- CHECK_BB(gwi_enum_add(gwi, "ENUM1", 1))
- CHECK_BB(gwi_enum_add(gwi, "ENUM2", 2))
- CHECK_BB(gwi_enum_add(gwi, "ENUM3", 3))
- CHECK_BB(gwi_enum_add(gwi, "ENUM4", 4))
- CHECK_BB(gwi_enum_add(gwi, "ENUM5", 5))
- CHECK_BB(gwi_enum_add(gwi, "ENUM6", 6))
- CHECK_BB(gwi_enum_add(gwi, "ENUM7", 7))
- CHECK_BB(gwi_enum_add(gwi, "ENUM8", 8))
- CHECK_BB(gwi_enum_add(gwi, "ENUM9", 9))
- CHECK_OB(gwi_enum_end(gwi))
+ GWI_OB((t_enum = gwi_mk_type(gwi, "Enum", 0, NULL)))
+ GWI_BB(gwi_class_ini(gwi, t_enum, NULL, NULL))
+ GWI_BB(gwi_enum_ini(gwi, 0))
+ GWI_BB(gwi_enum_add(gwi, "ENUM0", 0))
+ GWI_BB(gwi_enum_add(gwi, "ENUM1", 1))
+ GWI_BB(gwi_enum_add(gwi, "ENUM2", 2))
+ GWI_BB(gwi_enum_add(gwi, "ENUM3", 3))
+ GWI_BB(gwi_enum_add(gwi, "ENUM4", 4))
+ GWI_BB(gwi_enum_add(gwi, "ENUM5", 5))
+ GWI_BB(gwi_enum_add(gwi, "ENUM6", 6))
+ GWI_BB(gwi_enum_add(gwi, "ENUM7", 7))
+ GWI_BB(gwi_enum_add(gwi, "ENUM8", 8))
+ GWI_BB(gwi_enum_add(gwi, "ENUM9", 9))
+ GWI_OB(gwi_enum_end(gwi))
- CHECK_BB(gwi_enum_ini(gwi, "Enumtest"))
- CHECK_BB(gwi_enum_add(gwi, "TYPED_ENUM0", 0))
- CHECK_BB(gwi_enum_add(gwi, "TYPED_ENUM1", 1))
- CHECK_BB(gwi_enum_add(gwi, "TYPED_ENUM2", 2))
- CHECK_BB(gwi_enum_add(gwi, "TYPED_ENUM3", 3))
- CHECK_BB(gwi_enum_add(gwi, "TYPED_ENUM4", 4))
- CHECK_BB(gwi_enum_add(gwi, "TYPED_ENUM5", 5))
- CHECK_BB(gwi_enum_add(gwi, "TYPED_ENUM6", 6))
- CHECK_BB(gwi_enum_add(gwi, "TYPED_ENUM7", 7))
- CHECK_BB(gwi_enum_add(gwi, "TYPED_ENUM8", 8))
- CHECK_BB(gwi_enum_add(gwi, "TYPED_ENUM9", 9))
- CHECK_OB(gwi_enum_end(gwi))
- CHECK_OB(gwi_class_end(gwi))
+ GWI_BB(gwi_enum_ini(gwi, "Enumtest"))
+ GWI_BB(gwi_enum_add(gwi, "TYPED_ENUM0", 0))
+ GWI_BB(gwi_enum_add(gwi, "TYPED_ENUM1", 1))
+ GWI_BB(gwi_enum_add(gwi, "TYPED_ENUM2", 2))
+ GWI_BB(gwi_enum_add(gwi, "TYPED_ENUM3", 3))
+ GWI_BB(gwi_enum_add(gwi, "TYPED_ENUM4", 4))
+ GWI_BB(gwi_enum_add(gwi, "TYPED_ENUM5", 5))
+ GWI_BB(gwi_enum_add(gwi, "TYPED_ENUM6", 6))
+ GWI_BB(gwi_enum_add(gwi, "TYPED_ENUM7", 7))
+ GWI_BB(gwi_enum_add(gwi, "TYPED_ENUM8", 8))
+ GWI_BB(gwi_enum_add(gwi, "TYPED_ENUM9", 9))
+ GWI_OB(gwi_enum_end(gwi))
+ GWI_OB(gwi_class_end(gwi))
return GW_OK;
}
GWION_IMPORT(extend_array_test) {
Type t_array_ext;
- CHECK_OB((t_array_ext = gwi_mk_type(gwi, "ArrayExt", SZ_INT, NULL)))
- CHECK_BB(gwi_class_ini(gwi, t_array_ext, NULL, NULL))
+ GWI_OB((t_array_ext = gwi_mk_type(gwi, "ArrayExt", SZ_INT, NULL)))
+ GWI_BB(gwi_class_ini(gwi, t_array_ext, NULL, NULL))
Type_Decl* td = new_type_decl(gwi->gwion->st->p, new_id_list(gwi->gwion->st->p, insert_symbol(gwi->gwion->st, "float"), GWI_LOC));
Exp e = new_exp_prim_int(gwi->gwion->st->p, 1, GWI_LOC);
Array_Sub array = new_array_sub(gwi->gwion->st->p, e);
add_type_decl_array(td, array);
- CHECK_BB(gwi_class_ext(gwi, td))
- CHECK_BB(gwi_class_end(gwi))
+ GWI_BB(gwi_class_ext(gwi, td))
+ GWI_BB(gwi_class_end(gwi))
return GW_OK;
}
GWION_IMPORT(extend_event_test) {
Type t_ev ;
- CHECK_OB((t_ev = gwi_mk_type(gwi, "Ev", SZ_INT , NULL)))
- CHECK_BB(gwi_class_ini(gwi, t_ev, ev_ctor, NULL))
+ GWI_OB((t_ev = gwi_mk_type(gwi, "Ev", SZ_INT , NULL)))
+ GWI_BB(gwi_class_ini(gwi, t_ev, ev_ctor, NULL))
Type_Decl* td = new_type_decl(gwi->gwion->st->p, new_id_list(gwi->gwion->st->p, insert_symbol(gwi->gwion->st, "Event"), GWI_LOC));
- CHECK_BB(gwi_class_ext(gwi, td))
- CHECK_BB(gwi_class_end(gwi))
+ GWI_BB(gwi_class_ext(gwi, td))
+ GWI_BB(gwi_class_end(gwi))
return GW_OK;
}
GWION_IMPORT(extend_pair_test) {
m_str types[] = { "A", "B" };
Type t_pair_ext ;
- CHECK_OB((t_pair_ext = gwi_mk_type(gwi, "PairExt", SZ_INT , NULL)))
- CHECK_BB(gwi_tmpl_ini(gwi, 2, types))
- CHECK_BB(gwi_class_ini(gwi, t_pair_ext, NULL, NULL))
- CHECK_BB(gwi_tmpl_end(gwi))
+ GWI_OB((t_pair_ext = gwi_mk_type(gwi, "PairExt", SZ_INT , NULL)))
+ GWI_BB(gwi_tmpl_ini(gwi, 2, types))
+ GWI_BB(gwi_class_ini(gwi, t_pair_ext, NULL, NULL))
+ GWI_BB(gwi_tmpl_end(gwi))
Type_Decl* td = new_type_decl(gwi->gwion->st->p, new_id_list(gwi->gwion->st->p, insert_symbol(gwi->gwion->st, "Pair"), GWI_LOC));
Type_Decl* td0 = new_type_decl(gwi->gwion->st->p ,new_id_list(gwi->gwion->st->p, insert_symbol(gwi->gwion->st, "A"), GWI_LOC));
Type_Decl* td1 = new_type_decl(gwi->gwion->st->p ,new_id_list(gwi->gwion->st->p, insert_symbol(gwi->gwion->st, "B"), GWI_LOC));
Type_List tl1 = new_type_list(gwi->gwion->st->p, td1, NULL);
Type_List tl0 = new_type_list(gwi->gwion->st->p,td0, tl1);
td->types = tl0;
- CHECK_BB(gwi_class_ext(gwi, td))
- CHECK_BB(gwi_class_end(gwi))
+ GWI_BB(gwi_class_ext(gwi, td))
+ GWI_BB(gwi_class_end(gwi))
return GW_OK;
}
static MFUN(test_func) { puts("test"); }
GWION_IMPORT(typedef_test) {
Type t_func_typedef;
- CHECK_OB((t_func_typedef = gwi_mk_type(gwi, "FuncTypedef", SZ_INT , NULL)))
- CHECK_BB(gwi_fptr_ini(gwi, "void", "PtrType"))
- CHECK_OB(gwi_fptr_end(gwi, 0))
+ GWI_OB((t_func_typedef = gwi_mk_type(gwi, "FuncTypedef", SZ_INT , NULL)))
+ GWI_BB(gwi_fptr_ini(gwi, "void", "PtrType"))
+ GWI_OB(gwi_fptr_end(gwi, 0))
- CHECK_BB(gwi_class_ini(gwi, t_func_typedef, NULL, NULL))
- CHECK_BB(gwi_fptr_ini(gwi, "void", "PtrType"))
- CHECK_OB(gwi_fptr_end(gwi, ae_flag_static))
- CHECK_BB(gwi_func_ini(gwi, "void", "test_func", test_func))
- CHECK_BB(gwi_func_end(gwi, ae_flag_static))
- CHECK_BB(gwi_item_ini(gwi, "PtrType", "ptr"))
- CHECK_BB(gwi_item_end(gwi, ae_flag_static, NULL))
- CHECK_BB(gwi_class_end(gwi))
+ GWI_BB(gwi_class_ini(gwi, t_func_typedef, NULL, NULL))
+ GWI_BB(gwi_fptr_ini(gwi, "void", "PtrType"))
+ GWI_OB(gwi_fptr_end(gwi, ae_flag_static))
+ GWI_BB(gwi_func_ini(gwi, "void", "test_func", test_func))
+ GWI_BB(gwi_func_end(gwi, ae_flag_static))
+ GWI_BB(gwi_item_ini(gwi, "PtrType", "ptr"))
+ GWI_BB(gwi_item_end(gwi, ae_flag_static, NULL))
+ GWI_BB(gwi_class_end(gwi))
return GW_OK;
}
}
GWION_IMPORT(global_func_test) {
- CHECK_BB(gwi_func_ini(gwi, "int", "test", coverage_int))
- CHECK_BB(gwi_func_arg(gwi, "int", "i"))
- CHECK_BB(gwi_func_end(gwi, 0))
+ GWI_BB(gwi_func_ini(gwi, "int", "test", coverage_int))
+ GWI_BB(gwi_func_arg(gwi, "int", "i"))
+ GWI_BB(gwi_func_end(gwi, 0))
return GW_OK;
}
// ALLOC_PTR(i, m_uint, 1);
const M_Object obj = new_object(gwi->gwion->mp, NULL, gwi->gwion->type[et_string]);
STRING(obj) = s_name(insert_symbol(gwi->gwion->st, "test"));
- CHECK_BB(gwi_item_ini(gwi,"string", "i"))
- CHECK_BB(gwi_item_end(gwi, 0, obj))
+ GWI_BB(gwi_item_ini(gwi,"string", "i"))
+ GWI_BB(gwi_item_end(gwi, 0, obj))
return GW_OK;
}
static MFUN(test_mfun){}
GWION_IMPORT(invalid_arg_test) {
Type t_invalid_var_type ;
- CHECK_OB((t_invalid_var_type = gwi_mk_type(gwi, "invalid_var_type",
+ GWI_OB((t_invalid_var_type = gwi_mk_type(gwi, "invalid_var_type",
SZ_INT , NULL)))
- CHECK_BB(gwi_class_ini(gwi, t_invalid_var_type, NULL, NULL))
- CHECK_BB(gwi_func_ini(gwi, "int[]", "func", test_mfun))
- CHECK_BB(gwi_func_arg(gwi, ".int", "i"))
- CHECK_BB(gwi_func_end(gwi, ae_flag_static))
+ GWI_BB(gwi_class_ini(gwi, t_invalid_var_type, NULL, NULL))
+ GWI_BB(gwi_func_ini(gwi, "int[]", "func", test_mfun))
+ GWI_BB(gwi_func_arg(gwi, ".int", "i"))
+ GWI_BB(gwi_func_end(gwi, ae_flag_static))
- CHECK_BB(gwi_class_end(gwi))
+ GWI_BB(gwi_class_end(gwi))
return GW_OK;
}
static MFUN(test_mfun){}
GWION_IMPORT(inalid_array_test) {
Type t_invalid_var_type;
- CHECK_OB((t_invalid_var_type = gwi_mk_type(gwi, "invalid_var_type",
+ GWI_OB((t_invalid_var_type = gwi_mk_type(gwi, "invalid_var_type",
SZ_INT , NULL)))
- CHECK_BB(gwi_class_ini(gwi, t_invalid_var_type, NULL, NULL))
- CHECK_BB(gwi_func_ini(gwi, "int[]", "func", test_mfun))
- CHECK_BB(gwi_func_arg(gwi, "int[][]", "i"))
- CHECK_BB(gwi_func_arg(gwi, "int", "j[]"))
- CHECK_BB(gwi_func_arg(gwi, "int[]", "k[]"))
- CHECK_BB(gwi_func_arg(gwi, "int", "l"))
- CHECK_BB(gwi_func_end(gwi, ae_flag_static))
+ GWI_BB(gwi_class_ini(gwi, t_invalid_var_type, NULL, NULL))
+ GWI_BB(gwi_func_ini(gwi, "int[]", "func", test_mfun))
+ GWI_BB(gwi_func_arg(gwi, "int[][]", "i"))
+ GWI_BB(gwi_func_arg(gwi, "int", "j[]"))
+ GWI_BB(gwi_func_arg(gwi, "int[]", "k[]"))
+ GWI_BB(gwi_func_arg(gwi, "int", "l"))
+ GWI_BB(gwi_func_end(gwi, ae_flag_static))
- CHECK_BB(gwi_func_ini(gwi, "int[]", "func", test_mfun))
- CHECK_BB(gwi_func_arg(gwi, "int", "j[][]"))
- CHECK_BB(gwi_func_arg(gwi, "int[]", "+k[][][]"))
- CHECK_BB(gwi_func_arg(gwi, "int", "l"))
- CHECK_BB(gwi_func_end(gwi, ae_flag_static))
+ GWI_BB(gwi_func_ini(gwi, "int[]", "func", test_mfun))
+ GWI_BB(gwi_func_arg(gwi, "int", "j[][]"))
+ GWI_BB(gwi_func_arg(gwi, "int[]", "+k[][][]"))
+ GWI_BB(gwi_func_arg(gwi, "int", "l"))
+ GWI_BB(gwi_func_end(gwi, ae_flag_static))
- CHECK_BB(gwi_func_ini(gwi, "int[]", "func", test_mfun))
- CHECK_BB(gwi_func_arg(gwi, "+int", "j[][]"))
- CHECK_BB(gwi_func_arg(gwi, "int[]", "+k[][][]"))
- CHECK_BB(gwi_func_end(gwi, ae_flag_static))
+ GWI_BB(gwi_func_ini(gwi, "int[]", "func", test_mfun))
+ GWI_BB(gwi_func_arg(gwi, "+int", "j[][]"))
+ GWI_BB(gwi_func_arg(gwi, "int[]", "+k[][][]"))
+ GWI_BB(gwi_func_end(gwi, ae_flag_static))
- CHECK_BB(gwi_class_end(gwi))
+ GWI_BB(gwi_class_end(gwi))
return GW_OK;
}
static MFUN(test_mfun){}
GWION_IMPORT(invalid_func_test) {
Type t_invalid_var_type ;
- CHECK_OB((t_invalid_var_type = gwi_mk_type(gwi, "invalid_var_type",
+ GWI_OB((t_invalid_var_type = gwi_mk_type(gwi, "invalid_var_type",
SZ_INT , NULL)))
- CHECK_BB(gwi_class_ini(gwi, t_invalid_var_type, NULL, NULL))
- CHECK_BB(gwi_func_ini(gwi, ".int", "i", test_mfun))
- CHECK_BB(gwi_func_end(gwi, ae_flag_static))
+ GWI_BB(gwi_class_ini(gwi, t_invalid_var_type, NULL, NULL))
+ GWI_BB(gwi_func_ini(gwi, ".int", "i", test_mfun))
+ GWI_BB(gwi_func_end(gwi, ae_flag_static))
- CHECK_BB(gwi_class_end(gwi))
+ GWI_BB(gwi_class_end(gwi))
return GW_OK;
}
GWION_IMPORT(invalid_type1_test) {
Type t_invalid_var_type;
- CHECK_OB((t_invalid_var_type = gwi_mk_type(gwi, "invalid_var_type",
+ GWI_OB((t_invalid_var_type = gwi_mk_type(gwi, "invalid_var_type",
SZ_INT , NULL)))
- CHECK_BB(gwi_class_ini(gwi, t_invalid_var_type, NULL, NULL))
- CHECK_BB(gwi_item_ini(gwi,"i|nt", "test"))
- CHECK_BB(gwi_item_end(gwi, 0, NULL))
- CHECK_BB(gwi_class_end(gwi))
+ GWI_BB(gwi_class_ini(gwi, t_invalid_var_type, NULL, NULL))
+ GWI_BB(gwi_item_ini(gwi,"i|nt", "test"))
+ GWI_BB(gwi_item_end(gwi, 0, NULL))
+ GWI_BB(gwi_class_end(gwi))
return GW_OK;
}
GWION_IMPORT(invalid_type2_test) {
Type t_invalid_var_type ;
- CHECK_OB((t_invalid_var_type = gwi_mk_type(gwi, "invalid_var_type",
+ GWI_OB((t_invalid_var_type = gwi_mk_type(gwi, "invalid_var_type",
SZ_INT , NULL)))
- CHECK_BB(gwi_class_ini(gwi, t_invalid_var_type, NULL, NULL))
- CHECK_BB(gwi_item_ini(gwi,".int", "test"))
- CHECK_BB(gwi_item_end(gwi, 0, NULL))
- CHECK_BB(gwi_class_end(gwi))
+ GWI_BB(gwi_class_ini(gwi, t_invalid_var_type, NULL, NULL))
+ GWI_BB(gwi_item_ini(gwi,".int", "test"))
+ GWI_BB(gwi_item_end(gwi, 0, NULL))
+ GWI_BB(gwi_class_end(gwi))
return GW_OK;
}
GWION_IMPORT(invalid_type3_test) {
Type t_invalid_var_type ;
- CHECK_OB((t_invalid_var_type = gwi_mk_type(gwi, ".invalid_var_type",
+ GWI_OB((t_invalid_var_type = gwi_mk_type(gwi, ".invalid_var_type",
SZ_INT , NULL)))
- CHECK_BB(gwi_class_ini(gwi, t_invalid_var_type, NULL, NULL))
- CHECK_BB(gwi_item_ini(gwi,".int", "test"))
- CHECK_BB(gwi_item_end(gwi, 0, NULL))
- CHECK_BB(gwi_class_end(gwi))
+ GWI_BB(gwi_class_ini(gwi, t_invalid_var_type, NULL, NULL))
+ GWI_BB(gwi_item_ini(gwi,".int", "test"))
+ GWI_BB(gwi_item_end(gwi, 0, NULL))
+ GWI_BB(gwi_class_end(gwi))
return GW_OK;
}
GWION_IMPORT(op_already_imported) {
- CHECK_BB(gwi_oper_ini(gwi, "int", "int", "int"))
- CHECK_BB(gwi_oper_end(gwi, "=>", NULL))
+ GWI_BB(gwi_oper_ini(gwi, "int", "int", "int"))
+ GWI_BB(gwi_oper_end(gwi, "=>", NULL))
return GW_OK;
}
GWION_IMPORT(static_string_test) {
const M_Object obj = new_object(gwi->gwion->mp, NULL, gwi->gwion->type[et_string]);
STRING(obj) = s_name(insert_symbol(gwi->gwion->st, "test static string"));
- CHECK_BB(gwi_item_ini(gwi, "string", "self"))
- CHECK_BB(gwi_item_end(gwi, ae_flag_global, obj))
+ GWI_BB(gwi_item_ini(gwi, "string", "self"))
+ GWI_BB(gwi_item_end(gwi, ae_flag_global, obj))
return GW_OK;
}
static MFUN(template_arg_fun) {}
GWION_IMPORT(template_arg_test) {
Type t_template_arg;
- CHECK_OB((t_template_arg = gwi_mk_type(gwi, "TemplateArg", SZ_INT , NULL)))
- CHECK_BB(gwi_class_ini(gwi, t_template_arg, NULL, NULL))
- CHECK_BB(gwi_func_ini(gwi, "int", "set", template_arg_fun))
- CHECK_BB(gwi_func_arg(gwi, "Pair<Ptr<int>,float>","test"))
- CHECK_BB(gwi_func_end(gwi, 0))
- CHECK_BB(gwi_class_end(gwi))
+ GWI_OB((t_template_arg = gwi_mk_type(gwi, "TemplateArg", SZ_INT , NULL)))
+ GWI_BB(gwi_class_ini(gwi, t_template_arg, NULL, NULL))
+ GWI_BB(gwi_func_ini(gwi, "int", "set", template_arg_fun))
+ GWI_BB(gwi_func_arg(gwi, "Pair<Ptr<int>,float>","test"))
+ GWI_BB(gwi_func_end(gwi, 0))
+ GWI_BB(gwi_class_end(gwi))
return GW_OK;
}
#include "import.h"
GWION_IMPORT(union_test) {
- CHECK_BB(gwi_union_ini(gwi, NULL))
- CHECK_BB(gwi_union_add(gwi,"float", "f"))
- CHECK_BB(gwi_union_add(gwi,"int", "i"))
- CHECK_OB(gwi_union_end(gwi, 0))
+ GWI_BB(gwi_union_ini(gwi, NULL))
+ GWI_BB(gwi_union_add(gwi,"float", "f"))
+ GWI_BB(gwi_union_add(gwi,"int", "i"))
+ GWI_OB(gwi_union_end(gwi, 0))
return GW_OK;
}
GWION_IMPORT(variadic test) {
const Type t_variadic = gwi_mk_type(gwi, "Variadic", SZ_INT, "Object");
- CHECK_BB(gwi_class_ini(gwi, t_variadic, NULL, NULL))
- CHECK_BB(gwi_func_ini(gwi, "void", "member", m_variadic))
- CHECK_BB(gwi_func_arg(gwi, "string", "format"))
- CHECK_BB(gwi_func_end(gwi, ae_flag_variadic))
- CHECK_BB(gwi_func_ini(gwi, "void", "test", m_test))
- CHECK_BB(gwi_func_end(gwi, 0))
- CHECK_BB(gwi_class_end(gwi))
+ GWI_BB(gwi_class_ini(gwi, t_variadic, NULL, NULL))
+ GWI_BB(gwi_func_ini(gwi, "void", "member", m_variadic))
+ GWI_BB(gwi_func_arg(gwi, "string", "format"))
+ GWI_BB(gwi_func_end(gwi, ae_flag_variadic))
+ GWI_BB(gwi_func_ini(gwi, "void", "test", m_test))
+ GWI_BB(gwi_func_end(gwi, 0))
+ GWI_BB(gwi_class_end(gwi))
return GW_OK;
}