From 90fd78bf6ee18b947d219933353704a72c0fb95d Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Sat, 17 Feb 2024 12:58:21 +0100 Subject: [PATCH] :art: boolify more things --- include/engine.h | 2 +- include/gwi.h | 2 +- include/import.h | 22 +- include/import/cdef.h | 2 +- include/import/fdef.h | 10 +- include/import/oper.h | 10 +- include/import/tdef.h | 2 +- include/import/udef.h | 6 +- include/lang_private.h | 42 ++-- include/operator.h | 4 - include/parse.h | 8 - include/plug.h | 2 +- src/emit/emit.c | 14 +- src/gwion.c | 2 +- src/import/import_cdef.c | 7 +- src/import/import_checker.c | 19 +- src/import/import_enum.c | 2 - src/import/import_fdef.c | 38 +-- src/import/import_internals.c | 14 +- src/import/import_oper.c | 30 +-- src/import/import_prim.c | 4 +- src/import/import_tdef.c | 8 +- src/import/import_udef.c | 22 +- src/lib/array.c | 222 ++++++++--------- src/lib/closure.c | 74 +++--- src/lib/deep_equal.c | 32 +-- src/lib/dict.c | 74 +++--- src/lib/engine.c | 42 ++-- src/lib/event.c | 14 +- src/lib/lib_class.c | 34 +-- src/lib/lib_gack.c | 8 +- src/lib/locale.c | 6 +- src/lib/modules.c | 26 +- src/lib/object_op.c | 53 ++-- src/lib/prim.c | 334 +++++++++++++------------- src/lib/ref.c | 8 +- src/lib/shred.c | 52 ++-- src/lib/sift.c | 26 +- src/lib/string.c | 78 +++--- src/lib/tmpl_info.c | 17 +- src/lib/ugen.c | 30 +-- src/lib/union.c | 44 ++-- src/lib/xork.c | 14 +- src/parse/check.c | 6 +- src/parse/scan1.c | 18 +- src/parse/scan2.c | 22 +- src/pass.c | 2 +- tests/plug/array.c | 10 +- tests/plug/array_in_var_name_fail.c | 4 +- tests/plug/callback.c | 10 +- tests/plug/class_template.c | 6 +- tests/plug/class_template_fail.c | 6 +- tests/plug/class_template_invalid.c | 6 +- tests/plug/compile_file.c | 5 +- tests/plug/compile_string.c | 2 +- tests/plug/coverage.c | 10 +- tests/plug/empty_union.c | 4 +- tests/plug/end_class.c | 2 +- tests/plug/enum.c | 22 +- tests/plug/enum_fail.c | 4 +- tests/plug/enum_fail2.c | 4 +- tests/plug/enum_fail3.c | 6 +- tests/plug/extend_array.c | 2 +- tests/plug/fail_on_next_arg.c | 6 +- tests/plug/fail_on_next_arg2.c | 8 +- tests/plug/fptr.c | 10 +- tests/plug/fptr_tmpl.c | 2 +- tests/plug/fptr_tmpl_fail.c | 2 +- tests/plug/func_fail.c | 8 +- tests/plug/func_fail2.c | 8 +- tests/plug/func_fail3.c | 8 +- tests/plug/func_fail4.c | 4 +- tests/plug/func_subscript_not_empty.c | 4 +- tests/plug/func_tmpl.c | 6 +- tests/plug/func_tmpl_fail.c | 4 +- tests/plug/func_too_many_arg.c | 40 +-- tests/plug/global_func.c | 6 +- tests/plug/invalid_arg.c | 8 +- tests/plug/invalid_array.c | 32 +-- tests/plug/invalid_func.c | 6 +- tests/plug/invalid_type1.c | 2 +- tests/plug/invalid_type2.c | 2 +- tests/plug/invalid_type3.c | 2 +- tests/plug/not_importing.c | 2 +- tests/plug/str2decl.c | 4 +- tests/plug/struct.c | 10 +- tests/plug/template_arg.c | 8 +- tests/plug/typedef_fail.c | 4 +- tests/plug/typedef_tmpl.c | 2 +- tests/plug/union.c | 8 +- tests/plug/union_fail_exp.c | 8 +- tests/plug/union_member.c | 10 +- tests/plug/union_name.c | 8 +- tests/plug/union_tmpl.c | 10 +- tests/plug/union_tmpl_fail.c | 10 +- tests/plug/union_tmpl_fail2.c | 12 +- tests/plug/union_tmpl_fail3.c | 10 +- tests/plug/vm_remove.c | 6 +- 98 files changed, 941 insertions(+), 950 deletions(-) diff --git a/include/engine.h b/include/engine.h index 4d1c008c..e45b900e 100644 --- a/include/engine.h +++ b/include/engine.h @@ -1,4 +1,4 @@ #ifndef __ENGINE #define __ENGINE -ANN m_bool type_engine_init(const Gwion gwion); +ANN bool type_engine_init(const Gwion gwion); #endif diff --git a/include/gwi.h b/include/gwi.h index d237ef30..4aab8a51 100644 --- a/include/gwi.h +++ b/include/gwi.h @@ -37,5 +37,5 @@ static inline Tmpl *gwi_tmpl(const Gwi gwi) { } ANN void gwi_effects(const Gwi gwi, const m_str name); -ANN bool gwi_run(const Gwion gwion, m_bool (*f)(const Gwi)); +ANN bool gwi_run(const Gwion gwion, bool (*f)(const Gwi)); #endif diff --git a/include/import.h b/include/import.h index 0a6242ff..b7714018 100644 --- a/include/import.h +++ b/include/import.h @@ -32,31 +32,41 @@ typedef struct Gwi_ *Gwi; gwi_set_loc(gwi, __FILE__, __LINE__); \ (void)(a); \ } +#define GWI_B(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 gwimport_##a(const Gwi gwi) +#define GWION_IMPORT(a) ANN bool gwimport_##a(const Gwi gwi) #else #define GWI_BB(a) \ { \ gwi_set_loc(gwi, (m_str)__FILE__, __LINE__); \ - CHECK_BB(a); \ + CHECK_B(a); \ + } +#define GWI_B(a) \ + { \ + gwi_set_loc(gwi, (m_str)__FILE__, __LINE__); \ + CHECK_B(a); \ } #define GWI_OB(a) \ { \ gwi_set_loc(gwi, (m_str)__FILE__, __LINE__); \ - CHECK_OB(a); \ + CHECK_B(a); \ } -#define GWION_IMPORT(a) ANN m_bool gwimport_##a(const Gwi gwi) +#define GWION_IMPORT(a) ANN bool gwimport_##a(const Gwi gwi) #endif #define ALLOC_PTR(p, a, b, c) \ b *a = (b *)_mp_calloc(p, sizeof(b)); \ *a = (b)c #define _CHECK_OP(op, check, func) \ - GWI_BB(gwi_oper_add(gwi, opck_##check)) \ - GWI_BB(gwi_oper_end(gwi, op, func)) + GWI_B(gwi_oper_add(gwi, opck_##check)) \ + GWI_B(gwi_oper_end(gwi, op, func)) #include "import/checker.h" #include "import/type.h" diff --git a/include/import/cdef.h b/include/import/cdef.h index 4c84ae33..255ba710 100644 --- a/include/import/cdef.h +++ b/include/import/cdef.h @@ -4,7 +4,7 @@ ANN2(1, 2) Type gwi_class_ini(const Gwi gwi, const m_str, const m_str parent); ANN2(1, 2) Type gwi_struct_ini(const Gwi gwi, const m_str); ANN2(1) void gwi_class_xtor(const Gwi gwi, const f_xtor ctor, const f_xtor dtor); -ANN m_int gwi_class_end(const Gwi gwi); +ANN bool gwi_class_end(const Gwi gwi); #define gwi_struct_end(a) gwi_class_end(a) ANN void inherit(const Type); #endif diff --git a/include/import/fdef.h b/include/import/fdef.h index b433f120..48cbfaf4 100644 --- a/include/import/fdef.h +++ b/include/import/fdef.h @@ -1,15 +1,15 @@ #ifndef __IMPORT_FUNC #define __IMPORT_FUNC -ANN m_int gwi_func_ini(const Gwi gwi, const __restrict__ m_str type, +ANN bool gwi_func_ini(const Gwi gwi, const __restrict__ m_str type, const __restrict__ m_str name); -ANN m_int gwi_func_arg(const Gwi gwi, const __restrict__ m_str t, +ANN bool gwi_func_arg(const Gwi gwi, const __restrict__ m_str t, const __restrict__ m_str n); -ANN m_int gwi_func_end(const Gwi gwi, const f_xfun addr, const ae_flag flag); -ANN m_int gwi_fptr_ini(const Gwi gwi, const m_str __restrict__ type, +ANN bool gwi_func_end(const Gwi gwi, const f_xfun addr, const ae_flag flag); +ANN bool gwi_fptr_ini(const Gwi gwi, const m_str __restrict__ type, const __restrict__ m_str name); ANN Type gwi_fptr_end(const Gwi gwi, const ae_flag flag); -ANN m_int gwi_func_arg(const Gwi gwi, const restrict m_str t, +ANN bool gwi_func_arg(const Gwi gwi, const restrict m_str t, const restrict m_str n); ANN void ck_clean_fdef(MemPool, ImportCK *); #endif diff --git a/include/import/oper.h b/include/import/oper.h index 131e96f8..d4d83117 100644 --- a/include/import/oper.h +++ b/include/import/oper.h @@ -2,11 +2,11 @@ #define __IMPORT_OPER ANN2(1) -m_int gwi_oper_ini(const Gwi gwi, const m_str l, const m_str r, const m_str t); -ANN m_int gwi_oper_add(const Gwi gwi, const opck); -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); +bool gwi_oper_ini(const Gwi gwi, const m_str l, const m_str r, const m_str t); +ANN bool gwi_oper_add(const Gwi gwi, const opck); +ANN bool gwi_oper_emi(const Gwi gwi, const opem); +ANN2(1) bool gwi_oper_end(const Gwi gwi, const m_str op, const f_instr f); +ANN bool gwi_oper_cond(const Gwi, const m_str, const f_instr, const f_instr); ANN void gwi_oper_eff(const Gwi gwi, const m_str effect); #define EQUALITY_OPER_INNER(sz, sign) \ POP_REG(shred, sz * 2 - SZ_INT); \ diff --git a/include/import/tdef.h b/include/import/tdef.h index 20378cff..816055e8 100644 --- a/include/import/tdef.h +++ b/include/import/tdef.h @@ -1,7 +1,7 @@ #ifndef __IMPORT_TYPEDEF #define __IMPORT_TYPEDEF -ANN m_int gwi_typedef_ini(const Gwi gwi, const restrict m_str type, +ANN bool gwi_typedef_ini(const Gwi gwi, const restrict m_str type, const restrict m_str name); ANN Type gwi_typedef_end(const Gwi gwi, const ae_flag flag); ANN void ck_clean_tdef(MemPool, ImportCK *); diff --git a/include/import/udef.h b/include/import/udef.h index 89ffa3e7..5e397bb3 100644 --- a/include/import/udef.h +++ b/include/import/udef.h @@ -1,10 +1,10 @@ #ifndef __IMPORT_UNION #define __IMPORT_UNION -ANN2(1) m_int gwi_union_ini(const Gwi gwi, const m_str name); -ANN m_int gwi_union_add(const Gwi gwi, const __restrict__ m_str type, +ANN2(1) bool gwi_union_ini(const Gwi gwi, const m_str name); +ANN bool gwi_union_add(const Gwi gwi, const __restrict__ m_str type, const __restrict__ m_str name); -ANN Type gwi_union_end(const Gwi gwi, const ae_flag flag); +ANN bool gwi_union_end(const Gwi gwi, const ae_flag flag); ANN void ck_clean_udef(MemPool, ImportCK *); #endif diff --git a/include/lang_private.h b/include/lang_private.h index 5c6fd972..4e7cddc7 100644 --- a/include/lang_private.h +++ b/include/lang_private.h @@ -1,24 +1,24 @@ #ifndef __LANG_PRIVATE #define __LANG_PRIVATE -ANN m_bool gwimport_class(const Gwi gwi); -ANN m_bool gwimport_prim(const Gwi gwi); -ANN m_bool gwimport_enum(const Gwi gwi); -ANN m_bool gwimport_object(const Gwi gwi); -ANN m_bool gwimport_func(const Gwi gwi); -ANN m_bool gwimport_string(const Gwi gwi); -ANN m_bool gwimport_shred(const Gwi gwi); -ANN m_bool gwimport_event(const Gwi gwi); -ANN m_bool gwimport_ugen(const Gwi gwi); -ANN m_bool gwimport_array(const Gwi gwi); -ANN m_bool gwimport_xork(const Gwi gwi); -ANN m_bool gwimport_modules(const Gwi gwi); -ANN m_bool gwimport_object_op(const Gwi gwi); -ANN m_bool gwimport_values(const Gwi gwi); -ANN m_bool gwimport_union(const Gwi gwi); -ANN m_bool gwimport_ref(const Gwi gwi); -ANN m_bool gwimport_deep_equal(const Gwi gwi); -ANN m_bool gwimport_dict(const Gwi gwi); -ANN m_bool gwimport_gack(const Gwi gwi); -ANN m_bool gwimport_sift(const Gwi gwi); -ANN m_bool gwimport_locale(const Gwi gwi); +ANN bool gwimport_class(const Gwi gwi); +ANN bool gwimport_prim(const Gwi gwi); +ANN bool gwimport_enum(const Gwi gwi); +ANN bool gwimport_object(const Gwi gwi); +ANN bool gwimport_func(const Gwi gwi); +ANN bool gwimport_string(const Gwi gwi); +ANN bool gwimport_shred(const Gwi gwi); +ANN bool gwimport_event(const Gwi gwi); +ANN bool gwimport_ugen(const Gwi gwi); +ANN bool gwimport_array(const Gwi gwi); +ANN bool gwimport_xork(const Gwi gwi); +ANN bool gwimport_modules(const Gwi gwi); +ANN bool gwimport_object_op(const Gwi gwi); +ANN bool gwimport_values(const Gwi gwi); +ANN bool gwimport_union(const Gwi gwi); +ANN bool gwimport_ref(const Gwi gwi); +ANN bool gwimport_deep_equal(const Gwi gwi); +ANN bool gwimport_dict(const Gwi gwi); +ANN bool gwimport_gack(const Gwi gwi); +ANN bool gwimport_sift(const Gwi gwi); +ANN bool gwimport_locale(const Gwi gwi); #endif diff --git a/include/operator.h b/include/operator.h index bb589dac..4f3b5cca 100644 --- a/include/operator.h +++ b/include/operator.h @@ -26,10 +26,6 @@ do { \ if (!f) return env->gwion->type[et_error]; \ } while (0) -#define CHECK_NB(f) \ - do { \ - if (f == env->gwion->type[et_error]) return GW_ERROR; \ - } while (0) #define CHECK_NO(f) \ do { \ if (f == env->gwion->type[et_error]) return NULL; \ diff --git a/include/parse.h b/include/parse.h index a9080e64..96d3a096 100644 --- a/include/parse.h +++ b/include/parse.h @@ -73,14 +73,6 @@ } #define HANDLE_EXP_FUNC(prefix, type, Arg) \ - DECL_EXP_FUNC(prefix, type, Arg) \ - ANN type prefix##_exp(const Arg arg, Exp* exp) { \ - do CHECK_BB(prefix##_exp_func[exp->exp_type](arg, &exp->d)); \ - while ((exp = exp->next)); \ - return GW_OK; \ - } - -#define HANDLE_EXP_FUNC_B(prefix, type, Arg) \ DECL_EXP_FUNC(prefix, type, Arg) \ ANN type prefix##_exp(const Arg arg, Exp* exp) { \ bool ok = true; \ diff --git a/include/plug.h b/include/plug.h index 7a59bdb1..a8d7f199 100644 --- a/include/plug.h +++ b/include/plug.h @@ -3,7 +3,7 @@ struct DriverData_; struct Gwi_; -typedef m_bool (*gwplugin_t) (struct Gwi_*); +typedef bool (*gwplugin_t) (struct Gwi_*); typedef void* (*gwmodini_t) (struct Gwion_ const* gwion, const Vector args); typedef void* (*gwmodend_t) (struct Gwion_ const* gwion, void *self); typedef void (*gwdriver_t) (struct DriverData_ *); diff --git a/src/emit/emit.c b/src/emit/emit.c index b38b19d6..39a46862 100644 --- a/src/emit/emit.c +++ b/src/emit/emit.c @@ -2119,7 +2119,7 @@ ANN static bool _emit_stmt_flow(const Emitter emit, const Stmt_Flow stmt, CHECK_B(scoped_stmt(emit, stmt->body)); if (stmt->is_do) { if (!is_const) { - CHECK_OB((op = _flow(emit, stmt->cond, NULL, !is_while))); + CHECK_B((op = _flow(emit, stmt->cond, NULL, !is_while))); op->m_val = index; } else if ((is_while && stmt->cond->d.prim.d.gwint.num) || (!is_while && !stmt->cond->d.prim.d.gwint.num)) { @@ -2448,7 +2448,7 @@ ANN static bool emit_case_head(const Emitter emit, Exp* base, ANN static bool emit_case_body(const Emitter emit, const struct Stmt_Match_ *stmt) { const Instr when = stmt->when ? emit_flow(emit, stmt->when) : NULL; - if (stmt->when) CHECK_OB(when); + if (stmt->when) CHECK_B(when); CHECK_B(emit_stmt_list(emit, stmt->list)); const Instr instr = emit_add_instr(emit, Goto); vector_add(&emit->env->scope->match->vec, (vtype)instr); @@ -2614,7 +2614,7 @@ ANN static bool emit_stmt_retry(const Emitter emit, #define emit_stmt_while emit_stmt_flow #define emit_stmt_until emit_stmt_flow -#define emit_stmt_spread bdummy_func +#define emit_stmt_spread dummy_func DECL_STMT_FUNC(emit, bool, Emitter); @@ -2883,10 +2883,10 @@ ANN bool emit_func_def(const Emitter emit, const Func_Def fdef) { return ret; } -#define emit_fptr_def bdummy_func -#define emit_trait_def bdummy_func -#define emit_extend_def bdummy_func -#define emit_prim_def bdummy_func +#define emit_fptr_def dummy_func +#define emit_trait_def dummy_func +#define emit_extend_def dummy_func +#define emit_prim_def dummy_func HANDLE_SECTION_FUNC(emit, bool, Emitter); diff --git a/src/gwion.c b/src/gwion.c index d1934b89..b6522325 100644 --- a/src/gwion.c +++ b/src/gwion.c @@ -117,7 +117,7 @@ ANN bool gwion_ini(const Gwion gwion, CliArg *arg) { gwion->type = (Type *)xcalloc(MAX_TYPE, sizeof(struct Type_ *)); arg->si = gwion->vm->bbq->si = new_soundinfo(gwion->mp); new_passes(gwion); - CHECK_b(arg_parse(gwion, arg)); + CHECK_B(arg_parse(gwion, arg)); if (arg->color == COLOR_NEVER) tcol_override_color_checks(0); else if (arg->color == COLOR_AUTO) diff --git a/src/import/import_cdef.c b/src/import/import_cdef.c index 09a46ac2..5176bdbc 100644 --- a/src/import/import_cdef.c +++ b/src/import/import_cdef.c @@ -17,11 +17,10 @@ #include "specialid.h" #include "template.h" -ANN static m_bool mk_dtor(MemPool p, const Type t, const m_uint d) { +ANN static void mk_dtor(MemPool p, const Type t, const m_uint d) { VM_Code code = t->nspc->dtor = new_vmcode(p, NULL, NULL, t->name, SZ_INT, true, false); code->native_func = (m_uint)d; set_tflag(t, tflag_dtor); - return GW_OK; } ANN2(1, 2) static void import_class_ini(const Env env, const Type t) { @@ -126,7 +125,7 @@ ANN Type gwi_struct_ini(const Gwi gwi, const m_str name) { return type_finish(gwi, t); } -ANN m_int gwi_class_end(const Gwi gwi) { +ANN bool gwi_class_end(const Gwi gwi) { if (gwi->gwion->data->cdoc && gwi->gwion->env->class_def->info->cdef) { gwi->gwfmt->indent--; gwfmt_indent(gwi->gwfmt); @@ -151,5 +150,5 @@ ANN m_int gwi_class_end(const Gwi gwi) { } */ env_pop(gwi->gwion->env, 0); - return GW_OK; + return false; } diff --git a/src/import/import_checker.c b/src/import/import_checker.c index 45c7ad7b..429f4639 100644 --- a/src/import/import_checker.c +++ b/src/import/import_checker.c @@ -80,7 +80,10 @@ ANN bool str2var(const Gwion gwion, Var_Decl *vd, const m_str path, const loc_t return true; } -#define SPEC_ERROR (Specialized_List) GW_ERROR +#define ARG_ERROR (Arg_List) -1 +#define SPEC_ERROR (Specialized_List) -1 +#define TMPLARG_ERROR (TmplArg_List) -1 + ANN static bool _tmpl_list(const Gwion gwion, struct td_checker *tdc, Specialized_List *sl) { if(unlikely(!strncmp(tdc->str, "...", 3))) { @@ -148,18 +151,18 @@ ANN static TmplArg_List td_tmpl(const Gwion gwion, struct td_checker *tdc) { ++tdc->str; if (*tdc->str != '[') { GWION_ERR(tdc->loc, "invalid character"); - return (TmplArg_List)GW_ERROR; + return TMPLARG_ERROR; } ++tdc->str; TmplArg_List tl = new_mp_vector(gwion->mp, TmplArg, 0); if (!str2tl(gwion, tdc, &tl)) { free_tmplarg_list(gwion->mp, tl); - return (TmplArg_List)GW_ERROR; + return TMPLARG_ERROR; } if (tdc->str[0] != ']') { free_tmplarg_list(gwion->mp, tl); GWION_ERR(tdc->loc, "unfinished template"); - return (TmplArg_List)GW_ERROR; + return TMPLARG_ERROR; } ++tdc->str; return tl; @@ -182,7 +185,7 @@ ANN static Arg_List fptr_args(const Gwion gwion, struct td_checker *tdc) { Type_Decl *td = _str2td(gwion, tdc); if(!td) { free_arg_list(gwion->mp, args); - return (Arg_List)GW_ERROR; + return ARG_ERROR; } mp_vector_add(gwion->mp, &args, Arg, (Arg){ .var = {.td = td }}); } while(*tdc->str == ',' && tdc->str++); @@ -194,14 +197,14 @@ ANN static Type_Decl *str2td_fptr(const Gwion gwion, struct td_checker *tdc) { tdc->str++; Type_Decl *const ret_td = _str2td(gwion, tdc); const TmplArg_List tl = td_tmpl(gwion, tdc); - if (tl == (TmplArg_List)GW_ERROR) { + if (tl == TMPLARG_ERROR) { free_type_decl(gwion->mp, ret_td); return NULL; } const uint option = get_n(tdc, '?'); tdc->str++; Arg_List args = fptr_args(gwion, tdc); - if (args == (Arg_List)GW_ERROR) { + if (args == ARG_ERROR) { if(tl) free_tmplarg_list(gwion->mp, tl); free_type_decl(gwion->mp, ret_td); return NULL; @@ -241,7 +244,7 @@ ANN static Type_Decl *_str2td(const Gwion gwion, struct td_checker *tdc) { struct AC ac = {.str = tdc->str, .loc = tdc->loc}; CHECK_O(ac_run(gwion, &ac)); tdc->str = ac.str; - if (tl == (TmplArg_List)GW_ERROR) return NULL; + if (tl == TMPLARG_ERROR) return NULL; const uint option = get_n(tdc, '?'); Type_Decl *next = NULL; if (*tdc->str == '.') { diff --git a/src/import/import_enum.c b/src/import/import_enum.c index 08da25ea..61673033 100644 --- a/src/import/import_enum.c +++ b/src/import/import_enum.c @@ -17,7 +17,6 @@ //! start an enum definition //! \arg the importer //! \arg string defining a primitive type -//! why is return type m_int ? ANN m_int gwi_enum_ini(const Gwi gwi, const m_str type) { CHECK_b(ck_ini(gwi, ck_edef)); CHECK_OB((gwi->ck->xid = gwi_str2sym(gwi, type))); @@ -28,7 +27,6 @@ ANN m_int gwi_enum_ini(const Gwi gwi, const m_str type) { //! add an enum entry //! \arg the importer //! \arg name of the entry -//! TODO: change return type to m_bool ANN m_int gwi_enum_add(const Gwi gwi, const m_str name, const m_uint i) { CHECK_B(ck_ok(gwi, ck_edef)); DECL_OB(const Symbol, xid, = gwi_str2sym(gwi, name)); diff --git a/src/import/import_fdef.c b/src/import/import_fdef.c index bf75294c..61c71fdf 100644 --- a/src/import/import_fdef.c +++ b/src/import/import_fdef.c @@ -16,17 +16,17 @@ #include "clean.h" ANN2(1, 2, 3) -static m_bool dl_func_init(const Gwi gwi, const restrict m_str t, +static bool dl_func_init(const Gwi gwi, const restrict m_str t, const restrict m_str n) { CHECK_b(ck_ini(gwi, ck_fdef)); gwi->ck->name = n; CHECK_b(check_typename_def(gwi, gwi->ck)); - CHECK_OB((gwi->ck->td = gwi_str2td(gwi, t))); + CHECK_B((gwi->ck->td = gwi_str2td(gwi, t))); gwi->ck->mpv = new_mp_vector(gwi->gwion->mp, Arg, 0); - return GW_OK; + return true; } -ANN m_int gwi_func_ini(const Gwi gwi, const restrict m_str t, +ANN bool gwi_func_ini(const Gwi gwi, const restrict m_str t, const restrict m_str n) { return dl_func_init(gwi, t, n); } @@ -58,44 +58,44 @@ ANEW ANN static Func_Def import_fdef(const Gwi gwi, ImportCK *ck) { return fdef; } -ANN static m_bool section_fdef(const Gwi gwi, const Func_Def fdef) { +ANN static bool section_fdef(const Gwi gwi, const Func_Def fdef) { Section section = MK_SECTION(func, func_def, fdef); gwi_body(gwi, §ion); - return GW_OK; + return true; } -ANN static m_bool error_fdef(const Gwi gwi, const Func_Def fdef) { +ANN static bool error_fdef(const Gwi gwi, const Func_Def fdef) { func_def_cleaner(gwi->gwion, fdef); - return GW_ERROR; + return false; } -ANN m_int gwi_func_valid(const Gwi gwi, ImportCK *ck) { +ANN bool gwi_func_valid(const Gwi gwi, ImportCK *ck) { const Func_Def fdef = import_fdef(gwi, ck); fdef->builtin = true; if (safe_tflag(gwi->gwion->env->class_def, tflag_tmpl)) { section_fdef(gwi, fdef); fdef->d.dl_func_ptr = ck->addr; - return GW_OK; + return true; } if (!traverse_func_def(gwi->gwion->env, fdef)) return error_fdef(gwi, fdef); builtin_func(gwi->gwion, fdef->base->func, ck->addr); - return GW_OK; + return true; } -ANN m_int gwi_func_end(const Gwi gwi, const f_xfun addr, const ae_flag flag) { +ANN bool gwi_func_end(const Gwi gwi, const f_xfun addr, const ae_flag flag) { CHECK_b(ck_ok(gwi, ck_fdef)); gwi->ck->addr = addr; gwi->ck->flag = flag; - const m_bool ret = gwi_func_valid(gwi, gwi->ck); + const bool ret = gwi_func_valid(gwi, gwi->ck); ck_end(gwi); return ret; } -ANN m_int gwi_func_arg(const Gwi gwi, const restrict m_str t, +ANN bool gwi_func_arg(const Gwi gwi, const restrict m_str t, const restrict m_str n) { CHECK_b(ck_ok(gwi, ck_fdef)); - DECL_OB(Type_Decl *, td, = gwi_str2td(gwi, t)); + DECL_B(Type_Decl *, td, = gwi_str2td(gwi, t)); struct Var_Decl_ var; if(gwi_str2var(gwi, &var, n)) { Arg arg = { .var = MK_VAR(td, var) }; @@ -103,10 +103,10 @@ ANN m_int gwi_func_arg(const Gwi gwi, const restrict m_str t, return GW_OK; } free_type_decl(gwi->gwion->mp, td); - return GW_ERROR; + return false; } -ANN m_int gwi_fptr_ini(const Gwi gwi, const restrict m_str type, +ANN bool gwi_fptr_ini(const Gwi gwi, const restrict m_str type, const restrict m_str name) { return dl_func_init(gwi, type, name); } @@ -116,10 +116,10 @@ ANN static Fptr_Def import_fptr(const Gwi gwi) { return new_fptr_def(gwi->gwion->mp, base); } -ANN static m_bool section_fptr(const Gwi gwi, const Fptr_Def fdef) { +ANN static bool section_fptr(const Gwi gwi, const Fptr_Def fdef) { Section section = MK_SECTION(fptr, fptr_def, fdef); gwi_body(gwi, §ion); - return GW_OK; + return true; } ANN Type gwi_fptr_end(const Gwi gwi, const ae_flag flag) { diff --git a/src/import/import_internals.c b/src/import/import_internals.c index 19ef0cde..2b6daaef 100644 --- a/src/import/import_internals.c +++ b/src/import/import_internals.c @@ -29,28 +29,28 @@ ANN void gwi_reset(const Gwi gwi) { env_reset(gwi->gwion->env); } -ANN static bool run_with_doc(const Gwi gwi, m_bool (*f)(const Gwi)) { +ANN static bool run_with_doc(const Gwi gwi, bool (*f)(const Gwi)) { struct GwfmtState ls = {.builtin = true, .nindent = 4}; text_init(&ls.text, gwi->gwion->mp); Gwfmt gwfmter = {.mp = gwi->gwion->mp, .ls = &ls, .st = gwi->gwion->st }; gwfmt_indent(&gwfmter); gwfmt_util(&gwfmter, "{-}#!+ %s{0}\n", gwi->gwion->env->name); gwi->gwfmt = &gwfmter; - const m_bool ret = f(gwi); + const bool ret = f(gwi); fprintf(stdout, "%s", ls.text.str); - return ret > 0; + return ret; } -ANN bool gwi_run(const Gwion gwion, m_bool (*f)(const Gwi)) { +ANN bool gwi_run(const Gwion gwion, bool (*f)(const Gwi)) { const m_str name = gwion->env->name; // const Context ctx = gwion->env->context; // gwion->env->context = NULL; OperCK oper = {}; struct Gwi_ gwi = {.gwion = gwion, .oper = &oper}; - const m_bool ret = !gwion->data->cdoc ? f(&gwi) : run_with_doc(&gwi, f); - if (ret < 0) gwi_reset(&gwi); + const bool ret = !gwion->data->cdoc ? f(&gwi) : run_with_doc(&gwi, f); + if (!ret) gwi_reset(&gwi); gwion->env->name = name; // gwion->env->context = ctx; - return ret > 0; + return ret; } diff --git a/src/import/import_oper.c b/src/import/import_oper.c index 1c6a3bdc..22c18e39 100644 --- a/src/import/import_oper.c +++ b/src/import/import_oper.c @@ -30,7 +30,7 @@ ANN2(1) static inline Type gwi_get_type(const Gwi gwi, const m_str str) { } ANN2(1, 2) -static int import_op(const Gwi gwi, struct OperCK *const op, const f_instr f) { +static bool import_op(const Gwi gwi, struct OperCK *const op, const f_instr f) { const Type lhs = gwi_get_type(gwi, op->lhs), rhs = gwi_get_type(gwi, op->rhs), ret = gwi_get_type(gwi, op->ret); const struct Op_Func opfunc = { @@ -44,26 +44,26 @@ static int import_op(const Gwi gwi, struct OperCK *const op, const f_instr f) { .op = op->sym}; const bool b = add_op(gwi->gwion, &opi); op->effect.ptr = NULL; - return b ? GW_OK : GW_ERROR; + return b; } ANN2(1) -m_int gwi_oper_ini(const Gwi gwi, const restrict m_str l, +bool gwi_oper_ini(const Gwi gwi, const restrict m_str l, const restrict m_str r, const restrict m_str t) { gwi->oper->ret = t; gwi->oper->rhs = r; gwi->oper->lhs = l; - return GW_OK; + return true; } -ANN m_int gwi_oper_add(const Gwi gwi, Type (*ck)(Env, void *)) { +ANN bool gwi_oper_add(const Gwi gwi, Type (*ck)(Env, void *)) { gwi->oper->ck = ck; - return GW_OK; + return true; } -ANN m_int gwi_oper_emi(const Gwi gwi, const opem em) { +ANN bool gwi_oper_emi(const Gwi gwi, const opem em) { gwi->oper->em = em; - return GW_OK; + return true; } ANN void gwi_oper_eff(const Gwi gwi, const m_str effect) { @@ -71,7 +71,7 @@ ANN void gwi_oper_eff(const Gwi gwi, const m_str effect) { vector_add(&gwi->oper->effect, (m_uint)insert_symbol(gwi->gwion->st, effect)); } -ANN m_int gwi_oper_end(const Gwi gwi, const m_str op, const f_instr f) { +ANN bool gwi_oper_end(const Gwi gwi, const m_str op, const f_instr f) { if (gwi->gwion->data->cdoc) { gwfmt_indent(gwi->gwfmt); gwfmt_util(gwi->gwfmt, "{+C}operator{0} "); @@ -102,16 +102,16 @@ ANN m_int gwi_oper_end(const Gwi gwi, const m_str op, const f_instr f) { gwfmt_nl(gwi->gwfmt); } gwi->oper->sym = insert_symbol(gwi->gwion->st, op); - const m_bool ret = import_op(gwi, gwi->oper, f); + const bool ret = import_op(gwi, gwi->oper, f); gwi->oper->ck = NULL; gwi->oper->em = NULL; return ret; } -ANN m_int gwi_oper_cond(const Gwi gwi, const m_str type, const f_instr f1, +ANN bool gwi_oper_cond(const Gwi gwi, const m_str type, const f_instr f1, const f_instr f2) { - GWI_BB(gwi_oper_ini(gwi, NULL, type, "bool")) - GWI_BB(gwi_oper_end(gwi, "@conditional", f1)) - GWI_BB(gwi_oper_end(gwi, "@unconditional", f2)) - return GW_OK; + GWI_B(gwi_oper_ini(gwi, NULL, type, "bool")) + GWI_B(gwi_oper_end(gwi, "@conditional", f1)) + GWI_B(gwi_oper_end(gwi, "@unconditional", f2)) + return true; } diff --git a/src/import/import_prim.c b/src/import/import_prim.c index e33bac8d..37b3f15c 100644 --- a/src/import/import_prim.c +++ b/src/import/import_prim.c @@ -213,8 +213,8 @@ ANN Type mk_primitive(const Env env, const m_str name, const m_uint size) { prim_op(env, t, "$", opck_prim_cast, opem_bitcast); prim_implicit(env, t); } else if(size == SZ_INT) { - prim_op(env, t, ":=>", opck_rassign, (opem)bdummy_func); - prim_op(env, t, "$", NULL, (opem)bdummy_func); + prim_op(env, t, ":=>", opck_rassign, (opem)dummy_func); + prim_op(env, t, "$", NULL, (opem)dummy_func); prim_implicit(env, t); } // else provide function to get slices CHECK_O(mk_gack(env->gwion->mp, t, gack_prim)); diff --git a/src/import/import_tdef.c b/src/import/import_tdef.c index c2900b5b..65786d13 100644 --- a/src/import/import_tdef.c +++ b/src/import/import_tdef.c @@ -11,12 +11,12 @@ #include "import.h" #include "gwi.h" -ANN m_int gwi_typedef_ini(const Gwi gwi, const restrict m_str type, +ANN bool gwi_typedef_ini(const Gwi gwi, const restrict m_str type, const restrict m_str name) { - CHECK_b(ck_ini(gwi, ck_tdef)); + CHECK_B(ck_ini(gwi, ck_tdef)); gwi->ck->name = name; - CHECK_b(check_typename_def(gwi, gwi->ck)); - return (gwi->ck->td = gwi_str2td(gwi, type)) ? GW_OK : GW_ERROR; + CHECK_B(check_typename_def(gwi, gwi->ck)); + return !!(gwi->ck->td = gwi_str2td(gwi, type)); } ANN Type gwi_typedef_end(const Gwi gwi, const ae_flag flag) { diff --git a/src/import/import_udef.c b/src/import/import_udef.c index 73194526..6c35de28 100644 --- a/src/import/import_udef.c +++ b/src/import/import_udef.c @@ -25,25 +25,25 @@ ANN Exp* make_exp(const Gwi gwi, const m_str type, const m_str name) { return new_exp_decl(gwi->gwion->mp, td, &vd, gwi->loc); } -ANN m_int gwi_union_ini(const Gwi gwi, const m_str name) { - CHECK_b(ck_ini(gwi, ck_udef)); +ANN bool gwi_union_ini(const Gwi gwi, const m_str name) { + CHECK_B(ck_ini(gwi, ck_udef)); gwi->ck->name = name; CHECK_b(check_typename_def(gwi, gwi->ck)); gwi->ck->mpv = new_mp_vector(gwi->gwion->mp, Variable, 0); - return GW_OK; + return true; } -ANN m_int gwi_union_add(const Gwi gwi, const restrict m_str type, +ANN bool gwi_union_add(const Gwi gwi, const restrict m_str type, const restrict m_str name) { - CHECK_b(ck_ok(gwi, ck_udef)); - DECL_OB(Type_Decl *, td, = str2td(gwi->gwion, type, gwi->loc)); - DECL_OB(const Symbol, xid, = str2sym(gwi->gwion, name, gwi->loc)); + CHECK_B(ck_ok(gwi, ck_udef)); + DECL_B(Type_Decl *, td, = str2td(gwi->gwion, type, gwi->loc)); + DECL_B(const Symbol, xid, = str2sym(gwi->gwion, name, gwi->loc)); Variable um = { .td = td, .vd = { .tag = MK_TAG(xid, gwi->loc) } }; mp_vector_add(gwi->gwion->mp, &gwi->ck->list, Variable, um); // const Variable_List l = new_variable_list(gwi->gwion->mp, td, xid, gwi->loc); // l->next = gwi->ck->list; // gwi->ck->list = l; - return GW_OK; + return true; } ANN static Type union_type(const Gwi gwi, const Union_Def udef) { @@ -64,8 +64,8 @@ ANN static Type union_type(const Gwi gwi, const Union_Def udef) { return udef->type; } -ANN Type gwi_union_end(const Gwi gwi, const ae_flag flag) { - CHECK_O(ck_ok(gwi, ck_udef)); +ANN bool gwi_union_end(const Gwi gwi, const ae_flag flag) { + CHECK_B(ck_ok(gwi, ck_udef)); if (!gwi->ck->mpv->len) GWI_ERR_O(_("union is empty")); const Union_Def udef = new_union_def(gwi->gwion->mp, gwi->ck->mpv, gwi->loc); gwi->ck->list = NULL; @@ -78,7 +78,7 @@ ANN Type gwi_union_end(const Gwi gwi, const ae_flag flag) { const Type t = union_type(gwi, udef); if (!safe_tflag(t, tflag_tmpl)) free_union_def(gwi->gwion->mp, udef); ck_end(gwi); - return t; + return !!t; } ANN void ck_clean_udef(MemPool mp, ImportCK *ck) { diff --git a/src/lib/array.c b/src/lib/array.c index df17b9cb..91185662 100644 --- a/src/lib/array.c +++ b/src/lib/array.c @@ -958,123 +958,123 @@ GWION_IMPORT(array) { gwi_class_xtor(gwi, NULL, array_dtor); t_array->nspc->offset += SZ_INT*2; - GWI_BB(gwi_fptr_ini(gwi, "A", "map_t:[A]")) - GWI_BB(gwi_func_arg(gwi, "T", "elem")) - GWI_BB(gwi_fptr_end(gwi, ae_flag_static)) + GWI_B(gwi_fptr_ini(gwi, "A", "map_t:[A]")) + GWI_B(gwi_func_arg(gwi, "T", "elem")) + GWI_B(gwi_fptr_end(gwi, ae_flag_static)) - GWI_BB(gwi_fptr_ini(gwi, "Option:[A]", "compactmap_t:[A]")) - GWI_BB(gwi_func_arg(gwi, "T", "elem")) - GWI_BB(gwi_fptr_end(gwi, ae_flag_static)) + GWI_B(gwi_fptr_ini(gwi, "Option:[A]", "compactmap_t:[A]")) + GWI_B(gwi_func_arg(gwi, "T", "elem")) + GWI_B(gwi_fptr_end(gwi, ae_flag_static)) - GWI_BB(gwi_fptr_ini(gwi, "A", "fold_t:[A]")) - GWI_BB(gwi_func_arg(gwi, "T", "elem")) - GWI_BB(gwi_func_arg(gwi, "A", "acc")) - GWI_BB(gwi_fptr_end(gwi, ae_flag_static)) + GWI_B(gwi_fptr_ini(gwi, "A", "fold_t:[A]")) + GWI_B(gwi_func_arg(gwi, "T", "elem")) + GWI_B(gwi_func_arg(gwi, "A", "acc")) + GWI_B(gwi_fptr_end(gwi, ae_flag_static)) - GWI_BB(gwi_fptr_ini(gwi, "bool", "filter_t")) - GWI_BB(gwi_func_arg(gwi, "T", "elem")) - GWI_BB(gwi_fptr_end(gwi, ae_flag_static)) + GWI_B(gwi_fptr_ini(gwi, "bool", "filter_t")) + GWI_B(gwi_func_arg(gwi, "T", "elem")) + GWI_B(gwi_fptr_end(gwi, ae_flag_static)) - GWI_BB(gwi_fptr_ini(gwi, "T", "new_t")) - GWI_BB(gwi_func_arg(gwi, "int", "idx")) - GWI_BB(gwi_fptr_end(gwi, ae_flag_static)) + GWI_B(gwi_fptr_ini(gwi, "T", "new_t")) + GWI_B(gwi_func_arg(gwi, "int", "idx")) + GWI_B(gwi_fptr_end(gwi, ae_flag_static)) // put functions using T first - GWI_BB(gwi_func_ini(gwi, "bool", "remove")) - GWI_BB(gwi_func_arg(gwi, "int", "index")) - GWI_BB(gwi_func_end(gwi, vm_vector_rem, ae_flag_none)) - - GWI_BB(gwi_func_ini(gwi, "bool", "insert")) - GWI_BB(gwi_func_arg(gwi, "int", "index")) - GWI_BB(gwi_func_arg(gwi, "T", "data")) - GWI_BB(gwi_func_end(gwi, vm_vector_insert, ae_flag_none)) - - GWI_BB(gwi_func_ini(gwi, "int", "size")) - GWI_BB(gwi_func_end(gwi, vm_vector_size, ae_flag_none)) - GWI_BB(gwi_func_ini(gwi, "int", "depth")) - GWI_BB(gwi_func_end(gwi, vm_vector_depth, ae_flag_none)) - - GWI_BB(gwi_func_ini(gwi, "int", "cap")) - GWI_BB(gwi_func_end(gwi, vm_vector_cap, ae_flag_none)) - - GWI_BB(gwi_func_ini(gwi, "T", "random")) - GWI_BB(gwi_func_end(gwi, vm_vector_random, ae_flag_none)) - - GWI_BB(gwi_func_ini(gwi, "A[]", "map:[A]")) - GWI_BB(gwi_func_arg(gwi, "map_t:[A]", "data")) - GWI_BB(gwi_func_end(gwi, vm_vector_map, ae_flag_none)) - - GWI_BB(gwi_func_ini(gwi, "A[]", "compactMap:[A]")) - GWI_BB(gwi_func_arg(gwi, "compactmap_t:[A]", "data")) - GWI_BB(gwi_func_end(gwi, vm_vector_compactmap, ae_flag_none)) - - GWI_BB(gwi_func_ini(gwi, "T[]", "filter")) - GWI_BB(gwi_func_arg(gwi, "filter_t", "data")) - GWI_BB(gwi_func_end(gwi, vm_vector_filter, ae_flag_none)) - - GWI_BB(gwi_func_ini(gwi, "int", "count")) - GWI_BB(gwi_func_arg(gwi, "filter_t", "data")) - GWI_BB(gwi_func_end(gwi, vm_vector_count, ae_flag_none)) - - GWI_BB(gwi_func_ini(gwi, "A", "foldl:[A]")) - GWI_BB(gwi_func_arg(gwi, "fold_t:[A]", "data")) - GWI_BB(gwi_func_arg(gwi, "A", "initial")) - GWI_BB(gwi_func_end(gwi, vm_vector_foldl, ae_flag_none)) - - GWI_BB(gwi_func_ini(gwi, "A", "foldr:[A]")) - GWI_BB(gwi_func_arg(gwi, "fold_t:[A]", "data")) - GWI_BB(gwi_func_arg(gwi, "A", "initial")) - GWI_BB(gwi_func_end(gwi, vm_vector_foldr, ae_flag_none)) - - GWI_BB(gwi_func_ini(gwi, "auto", "new")) - GWI_BB(gwi_func_arg(gwi, "new_t", "init")) - GWI_BB(gwi_func_end(gwi, vm_vector_new, ae_flag_none)) - - GWI_BB(gwi_class_end(gwi)) - - GWI_BB(gwi_oper_ini(gwi, "Array", "Array", NULL)) - GWI_BB(gwi_oper_add(gwi, opck_array_at)) - GWI_BB(gwi_oper_end(gwi, ":=>", NULL)) - GWI_BB(gwi_oper_add(gwi, opck_array_implicit)) -// GWI_BB(gwi_oper_end(gwi, "@implicit", NULL)) - GWI_BB(gwi_oper_end(gwi, "@implicit", NoOp)) - GWI_BB(gwi_oper_ini(gwi, "Array", (m_str)OP_ANY_TYPE, NULL)) - GWI_BB(gwi_oper_add(gwi, opck_array_sl)) - GWI_BB(gwi_oper_emi(gwi, opem_array_sl)) - GWI_BB(gwi_oper_end(gwi, "<<", NULL)) - GWI_BB(gwi_oper_ini(gwi, (m_str)OP_ANY_TYPE, "Array", NULL)) - GWI_BB(gwi_oper_add(gwi, opck_array_sr)) - GWI_BB(gwi_oper_emi(gwi, opem_array_sr)) - GWI_BB(gwi_oper_end(gwi, ">>", NULL)) - GWI_BB(gwi_oper_ini(gwi, "Array", "Array", NULL)) - GWI_BB(gwi_oper_add(gwi, opck_array_cast)) - GWI_BB(gwi_oper_emi(gwi, opem_array_cast)) - GWI_BB(gwi_oper_end(gwi, "$", NULL)) - GWI_BB(gwi_oper_ini(gwi, "int", "Array", "int")) - GWI_BB(gwi_oper_add(gwi, opck_array_slice)) - GWI_BB(gwi_oper_emi(gwi, opem_array_slice)) - GWI_BB(gwi_oper_end(gwi, "[:]", NULL)) - GWI_BB(gwi_oper_ini(gwi, "int", "Array", NULL)) - GWI_BB(gwi_oper_add(gwi, opck_array)) - GWI_BB(gwi_oper_emi(gwi, opem_array_access)) - GWI_BB(gwi_oper_end(gwi, "[]", NULL)) - GWI_BB(gwi_oper_ini(gwi, "Array", NULL, "void")) - GWI_BB(gwi_oper_emi(gwi, opem_array_each_init)) - GWI_BB(gwi_oper_end(gwi, "@each_init", NULL)) - GWI_BB(gwi_oper_ini(gwi, "Array", NULL, "int")) - GWI_BB(gwi_oper_emi(gwi, opem_array_each)) - GWI_BB(gwi_oper_end(gwi, "@each", NULL)) - GWI_BB(gwi_oper_ini(gwi, "Array", NULL, NULL)) - GWI_BB(gwi_oper_add(gwi, opck_array_each_val)) - GWI_BB(gwi_oper_end(gwi, "@each_val", NULL)) - GWI_BB(gwi_oper_ini(gwi, "Array", NULL, "int")) - GWI_BB(gwi_oper_end(gwi, "@each_idx", NULL)) - GWI_BB(gwi_oper_ini(gwi, "Array", NULL, NULL)) - GWI_BB(gwi_oper_add(gwi, opck_array_scan)) - GWI_BB(gwi_oper_end(gwi, "class", NULL)) - - GWI_BB(gwi_oper_ini(gwi, (m_str)OP_ANY_TYPE, NULL, "bool")) - GWI_BB(gwi_oper_end(gwi, "@array_init", NoOp)) + GWI_B(gwi_func_ini(gwi, "bool", "remove")) + GWI_B(gwi_func_arg(gwi, "int", "index")) + GWI_B(gwi_func_end(gwi, vm_vector_rem, ae_flag_none)) + + GWI_B(gwi_func_ini(gwi, "bool", "insert")) + GWI_B(gwi_func_arg(gwi, "int", "index")) + GWI_B(gwi_func_arg(gwi, "T", "data")) + GWI_B(gwi_func_end(gwi, vm_vector_insert, ae_flag_none)) + + GWI_B(gwi_func_ini(gwi, "int", "size")) + GWI_B(gwi_func_end(gwi, vm_vector_size, ae_flag_none)) + GWI_B(gwi_func_ini(gwi, "int", "depth")) + GWI_B(gwi_func_end(gwi, vm_vector_depth, ae_flag_none)) + + GWI_B(gwi_func_ini(gwi, "int", "cap")) + GWI_B(gwi_func_end(gwi, vm_vector_cap, ae_flag_none)) + + GWI_B(gwi_func_ini(gwi, "T", "random")) + GWI_B(gwi_func_end(gwi, vm_vector_random, ae_flag_none)) + + GWI_B(gwi_func_ini(gwi, "A[]", "map:[A]")) + GWI_B(gwi_func_arg(gwi, "map_t:[A]", "data")) + GWI_B(gwi_func_end(gwi, vm_vector_map, ae_flag_none)) + + GWI_B(gwi_func_ini(gwi, "A[]", "compactMap:[A]")) + GWI_B(gwi_func_arg(gwi, "compactmap_t:[A]", "data")) + GWI_B(gwi_func_end(gwi, vm_vector_compactmap, ae_flag_none)) + + GWI_B(gwi_func_ini(gwi, "T[]", "filter")) + GWI_B(gwi_func_arg(gwi, "filter_t", "data")) + GWI_B(gwi_func_end(gwi, vm_vector_filter, ae_flag_none)) + + GWI_B(gwi_func_ini(gwi, "int", "count")) + GWI_B(gwi_func_arg(gwi, "filter_t", "data")) + GWI_B(gwi_func_end(gwi, vm_vector_count, ae_flag_none)) + + GWI_B(gwi_func_ini(gwi, "A", "foldl:[A]")) + GWI_B(gwi_func_arg(gwi, "fold_t:[A]", "data")) + GWI_B(gwi_func_arg(gwi, "A", "initial")) + GWI_B(gwi_func_end(gwi, vm_vector_foldl, ae_flag_none)) + + GWI_B(gwi_func_ini(gwi, "A", "foldr:[A]")) + GWI_B(gwi_func_arg(gwi, "fold_t:[A]", "data")) + GWI_B(gwi_func_arg(gwi, "A", "initial")) + GWI_B(gwi_func_end(gwi, vm_vector_foldr, ae_flag_none)) + + GWI_B(gwi_func_ini(gwi, "auto", "new")) + GWI_B(gwi_func_arg(gwi, "new_t", "init")) + GWI_B(gwi_func_end(gwi, vm_vector_new, ae_flag_none)) + + GWI_B(gwi_class_end(gwi)) + + GWI_B(gwi_oper_ini(gwi, "Array", "Array", NULL)) + GWI_B(gwi_oper_add(gwi, opck_array_at)) + GWI_B(gwi_oper_end(gwi, ":=>", NULL)) + GWI_B(gwi_oper_add(gwi, opck_array_implicit)) +// GWI_B(gwi_oper_end(gwi, "@implicit", NULL)) + GWI_B(gwi_oper_end(gwi, "@implicit", NoOp)) + GWI_B(gwi_oper_ini(gwi, "Array", (m_str)OP_ANY_TYPE, NULL)) + GWI_B(gwi_oper_add(gwi, opck_array_sl)) + GWI_B(gwi_oper_emi(gwi, opem_array_sl)) + GWI_B(gwi_oper_end(gwi, "<<", NULL)) + GWI_B(gwi_oper_ini(gwi, (m_str)OP_ANY_TYPE, "Array", NULL)) + GWI_B(gwi_oper_add(gwi, opck_array_sr)) + GWI_B(gwi_oper_emi(gwi, opem_array_sr)) + GWI_B(gwi_oper_end(gwi, ">>", NULL)) + GWI_B(gwi_oper_ini(gwi, "Array", "Array", NULL)) + GWI_B(gwi_oper_add(gwi, opck_array_cast)) + GWI_B(gwi_oper_emi(gwi, opem_array_cast)) + GWI_B(gwi_oper_end(gwi, "$", NULL)) + GWI_B(gwi_oper_ini(gwi, "int", "Array", "int")) + GWI_B(gwi_oper_add(gwi, opck_array_slice)) + GWI_B(gwi_oper_emi(gwi, opem_array_slice)) + GWI_B(gwi_oper_end(gwi, "[:]", NULL)) + GWI_B(gwi_oper_ini(gwi, "int", "Array", NULL)) + GWI_B(gwi_oper_add(gwi, opck_array)) + GWI_B(gwi_oper_emi(gwi, opem_array_access)) + GWI_B(gwi_oper_end(gwi, "[]", NULL)) + GWI_B(gwi_oper_ini(gwi, "Array", NULL, "void")) + GWI_B(gwi_oper_emi(gwi, opem_array_each_init)) + GWI_B(gwi_oper_end(gwi, "@each_init", NULL)) + GWI_B(gwi_oper_ini(gwi, "Array", NULL, "int")) + GWI_B(gwi_oper_emi(gwi, opem_array_each)) + GWI_B(gwi_oper_end(gwi, "@each", NULL)) + GWI_B(gwi_oper_ini(gwi, "Array", NULL, NULL)) + GWI_B(gwi_oper_add(gwi, opck_array_each_val)) + GWI_B(gwi_oper_end(gwi, "@each_val", NULL)) + GWI_B(gwi_oper_ini(gwi, "Array", NULL, "int")) + GWI_B(gwi_oper_end(gwi, "@each_idx", NULL)) + GWI_B(gwi_oper_ini(gwi, "Array", NULL, NULL)) + GWI_B(gwi_oper_add(gwi, opck_array_scan)) + GWI_B(gwi_oper_end(gwi, "class", NULL)) + + GWI_B(gwi_oper_ini(gwi, (m_str)OP_ANY_TYPE, NULL, "bool")) + GWI_B(gwi_oper_end(gwi, "@array_init", NoOp)) gwi_register_freearg(gwi, ArrayAlloc, freearg_array); return GW_OK; diff --git a/src/lib/closure.c b/src/lib/closure.c index 7b023f77..89050278 100644 --- a/src/lib/closure.c +++ b/src/lib/closure.c @@ -232,7 +232,7 @@ ANN static bool fptr_effects(const Env env, struct FptrInfo *info) { ANN static bool fptr_check(const Env env, struct FptrInfo *info) { // if(!info->lhs->def->base->tmpl != !info->rhs->def->base->tmpl) - // return GW_ERROR; + // return false; if(!info->lhs) ERR_b(info->exp->loc, _("can't resolve operator")); @@ -737,44 +737,44 @@ GWION_IMPORT(func) { t_closure->nspc->offset = SZ_INT*3; gwi_class_xtor(gwi, fptr_ctor, fptr_dtor); GWI_BB(gwi_set_global_type(gwi, t_closure, et_closure)) - GWI_BB(gwi_func_ini(gwi, "void", "default")); - GWI_BB(gwi_func_end(gwi, fptr_default, ae_flag_none)); + GWI_B(gwi_func_ini(gwi, "void", "default")); + GWI_B(gwi_func_end(gwi, fptr_default, ae_flag_none)); gwi_class_end(gwi); - GWI_BB(gwi_oper_ini(gwi, "funptr", NULL, NULL)) - GWI_BB(gwi_oper_add(gwi, opck_closure_scan)) - GWI_BB(gwi_oper_end(gwi, "class", NULL)) - - GWI_BB(gwi_oper_ini(gwi, (m_str)OP_ANY_TYPE, "function", NULL)) - GWI_BB(gwi_oper_add(gwi, opck_func_call)) - GWI_BB(gwi_oper_end(gwi, "=>", NULL)) - GWI_BB(gwi_oper_ini(gwi, (m_str)OP_ANY_TYPE, "funptr", NULL)) - GWI_BB(gwi_oper_add(gwi, opck_fptr_call)) - GWI_BB(gwi_oper_end(gwi, "=>", NULL)) - GWI_BB(gwi_oper_ini(gwi, "function", "funptr", NULL)) - GWI_BB(gwi_oper_add(gwi, opck_fptr_assign)) - GWI_BB(gwi_oper_emi(gwi, opem_fptr_assign)) - GWI_BB(gwi_oper_end(gwi, ":=>", NULL)) - GWI_BB(gwi_oper_add(gwi, opck_fptr_impl)) - GWI_BB(gwi_oper_emi(gwi, opem_fptr_impl)) - GWI_BB(gwi_oper_end(gwi, "@implicit", NULL)) - GWI_BB(gwi_oper_add(gwi, opck_fptr_cast)) - GWI_BB(gwi_oper_end(gwi, "$", NULL)) - GWI_BB(gwi_oper_ini(gwi, "operator", "funptr", NULL)) - GWI_BB(gwi_oper_add(gwi, opck_op_impl)) - GWI_BB(gwi_oper_emi(gwi, opem_op_impl)) - GWI_BB(gwi_oper_end(gwi, "@implicit", NULL)) - GWI_BB(gwi_oper_add(gwi, opck_op_cast)) - GWI_BB(gwi_oper_end(gwi, "$", NULL)) - GWI_BB(gwi_oper_ini(gwi, "function", "function", NULL)) - GWI_BB(gwi_oper_add(gwi, opck_auto_fptr)) - GWI_BB(gwi_oper_end(gwi, ":=>", int_r_assign)) - GWI_BB(gwi_oper_ini(gwi, "function", NULL, NULL)) - GWI_BB(gwi_oper_add(gwi, opck_func_partial)) - GWI_BB(gwi_oper_end(gwi, "@partial", NULL)) - GWI_BB(gwi_oper_ini(gwi, "Class", NULL, NULL)) - GWI_BB(gwi_oper_add(gwi, opck_class_partial)) - GWI_BB(gwi_oper_end(gwi, "@partial", NULL)) + GWI_B(gwi_oper_ini(gwi, "funptr", NULL, NULL)) + GWI_B(gwi_oper_add(gwi, opck_closure_scan)) + GWI_B(gwi_oper_end(gwi, "class", NULL)) + + GWI_B(gwi_oper_ini(gwi, (m_str)OP_ANY_TYPE, "function", NULL)) + GWI_B(gwi_oper_add(gwi, opck_func_call)) + GWI_B(gwi_oper_end(gwi, "=>", NULL)) + GWI_B(gwi_oper_ini(gwi, (m_str)OP_ANY_TYPE, "funptr", NULL)) + GWI_B(gwi_oper_add(gwi, opck_fptr_call)) + GWI_B(gwi_oper_end(gwi, "=>", NULL)) + GWI_B(gwi_oper_ini(gwi, "function", "funptr", NULL)) + GWI_B(gwi_oper_add(gwi, opck_fptr_assign)) + GWI_B(gwi_oper_emi(gwi, opem_fptr_assign)) + GWI_B(gwi_oper_end(gwi, ":=>", NULL)) + GWI_B(gwi_oper_add(gwi, opck_fptr_impl)) + GWI_B(gwi_oper_emi(gwi, opem_fptr_impl)) + GWI_B(gwi_oper_end(gwi, "@implicit", NULL)) + GWI_B(gwi_oper_add(gwi, opck_fptr_cast)) + GWI_B(gwi_oper_end(gwi, "$", NULL)) + GWI_B(gwi_oper_ini(gwi, "operator", "funptr", NULL)) + GWI_B(gwi_oper_add(gwi, opck_op_impl)) + GWI_B(gwi_oper_emi(gwi, opem_op_impl)) + GWI_B(gwi_oper_end(gwi, "@implicit", NULL)) + GWI_B(gwi_oper_add(gwi, opck_op_cast)) + GWI_B(gwi_oper_end(gwi, "$", NULL)) + GWI_B(gwi_oper_ini(gwi, "function", "function", NULL)) + GWI_B(gwi_oper_add(gwi, opck_auto_fptr)) + GWI_B(gwi_oper_end(gwi, ":=>", int_r_assign)) + GWI_B(gwi_oper_ini(gwi, "function", NULL, NULL)) + GWI_B(gwi_oper_add(gwi, opck_func_partial)) + GWI_B(gwi_oper_end(gwi, "@partial", NULL)) + GWI_B(gwi_oper_ini(gwi, "Class", NULL, NULL)) + GWI_B(gwi_oper_add(gwi, opck_class_partial)) + GWI_B(gwi_oper_end(gwi, "@partial", NULL)) gwi_register_freearg(gwi, GTmpl, freearg_gtmpl); gwi_register_freearg(gwi, DotTmpl, freearg_dottmpl); diff --git a/src/lib/deep_equal.c b/src/lib/deep_equal.c index f783dbb1..a794c25d 100644 --- a/src/lib/deep_equal.c +++ b/src/lib/deep_equal.c @@ -39,8 +39,8 @@ static OP_CHECK(opck_deep_ne_any) { return t; } -deep_any(emit, emit, em, EMIT, CHECK_BB, eq, ==); -deep_any(emit, emit, em, EMIT, CHECK_BB, ne, !=); +deep_any(emit, emit, em, EMIT, CHECK_B, eq, ==); +deep_any(emit, emit, em, EMIT, CHECK_B, ne, !=); // get members of a specific type static void type_get_member(const Gwion gwion, const Type t, const Vector v) { @@ -235,29 +235,29 @@ static OP_EMIT(opem_deep_equal) { GWION_IMPORT(deep_equal) { - GWI_BB(gwi_oper_ini(gwi, (m_str)OP_ANY_TYPE, (m_str)OP_ANY_TYPE, "bool")) + GWI_B(gwi_oper_ini(gwi, (m_str)OP_ANY_TYPE, (m_str)OP_ANY_TYPE, "bool")) gwidoc(gwi, "Deep Equality fallback"); - GWI_BB(gwi_oper_add(gwi, opck_deep_eq_any)) - GWI_BB(gwi_oper_emi(gwi, opem_deep_eq_any)) - GWI_BB(gwi_oper_end(gwi, "?=", NULL)) + GWI_B(gwi_oper_add(gwi, opck_deep_eq_any)) + GWI_B(gwi_oper_emi(gwi, opem_deep_eq_any)) + GWI_B(gwi_oper_end(gwi, "?=", NULL)) gwidoc(gwi, "Deep Inequality fallback"); - GWI_BB(gwi_oper_add(gwi, opck_deep_ne_any)) - GWI_BB(gwi_oper_emi(gwi, opem_deep_ne_any)) - GWI_BB(gwi_oper_end(gwi, "<>", NULL)) + GWI_B(gwi_oper_add(gwi, opck_deep_ne_any)) + GWI_B(gwi_oper_emi(gwi, opem_deep_ne_any)) + GWI_B(gwi_oper_end(gwi, "<>", NULL)) - GWI_BB(gwi_oper_ini(gwi, "@Compound", "@Compound", "bool")) + GWI_B(gwi_oper_ini(gwi, "@Compound", "@Compound", "bool")) gwidoc(gwi, "Deep Equality"); - GWI_BB(gwi_oper_add(gwi, opck_deep_equal)) - GWI_BB(gwi_oper_emi(gwi, opem_deep_equal)) - GWI_BB(gwi_oper_end(gwi, "?=", NULL)) + GWI_B(gwi_oper_add(gwi, opck_deep_equal)) + GWI_B(gwi_oper_emi(gwi, opem_deep_equal)) + GWI_B(gwi_oper_end(gwi, "?=", NULL)) gwidoc(gwi, "Deep Inequality"); - GWI_BB(gwi_oper_add(gwi, opck_deep_equal)) - GWI_BB(gwi_oper_emi(gwi, opem_deep_equal)) - GWI_BB(gwi_oper_end(gwi, "<>", NULL)) + GWI_B(gwi_oper_add(gwi, opck_deep_equal)) + GWI_B(gwi_oper_emi(gwi, opem_deep_equal)) + GWI_B(gwi_oper_end(gwi, "<>", NULL)) return GW_OK; } diff --git a/src/lib/dict.c b/src/lib/dict.c index daaf8b8e..3fc21a46 100644 --- a/src/lib/dict.c +++ b/src/lib/dict.c @@ -616,55 +616,55 @@ GWION_IMPORT(dict) { t_dict->nspc->offset += sizeof(struct HMap); gwi->gwion->type[et_dict] = t_dict; set_tflag(t_dict, tflag_infer); - GWI_BB(gwi_func_ini(gwi, "void", "remove")); - GWI_BB(gwi_func_arg(gwi, "Key", "key")); - GWI_BB(gwi_func_end(gwi, (f_xfun)1, ae_flag_none)); + GWI_B(gwi_func_ini(gwi, "void", "remove")); + GWI_B(gwi_func_arg(gwi, "Key", "key")); + GWI_B(gwi_func_end(gwi, (f_xfun)1, ae_flag_none)); - GWI_BB(gwi_class_end(gwi)) + GWI_B(gwi_class_end(gwi)) - GWI_BB(gwi_oper_ini(gwi, "Dict", NULL, NULL)) - GWI_BB(gwi_oper_add(gwi, opck_dict_scan)) - GWI_BB(gwi_oper_end(gwi, "class", NULL)) + GWI_B(gwi_oper_ini(gwi, "Dict", NULL, NULL)) + GWI_B(gwi_oper_add(gwi, opck_dict_scan)) + GWI_B(gwi_oper_end(gwi, "class", NULL)) - GWI_BB(gwi_oper_ini(gwi, "Dict", NULL, "int")) - GWI_BB(gwi_oper_emi(gwi, opem_dict_each)) - GWI_BB(gwi_oper_end(gwi, "@each", NULL)) + GWI_B(gwi_oper_ini(gwi, "Dict", NULL, "int")) + GWI_B(gwi_oper_emi(gwi, opem_dict_each)) + GWI_B(gwi_oper_end(gwi, "@each", NULL)) - GWI_BB(gwi_oper_ini(gwi, "Dict", NULL, "void")) - GWI_BB(gwi_oper_emi(gwi, opem_dict_each_init)) - GWI_BB(gwi_oper_end(gwi, "@each_init", NULL)) + GWI_B(gwi_oper_ini(gwi, "Dict", NULL, "void")) + GWI_B(gwi_oper_emi(gwi, opem_dict_each_init)) + GWI_B(gwi_oper_end(gwi, "@each_init", NULL)) - GWI_BB(gwi_oper_ini(gwi, "Dict", NULL, NULL)) - GWI_BB(gwi_oper_add(gwi, opck_dict_each_val)) - GWI_BB(gwi_oper_end(gwi, "@each_val", NULL)) + GWI_B(gwi_oper_ini(gwi, "Dict", NULL, NULL)) + GWI_B(gwi_oper_add(gwi, opck_dict_each_val)) + GWI_B(gwi_oper_end(gwi, "@each_val", NULL)) - GWI_BB(gwi_oper_ini(gwi, "Dict", NULL, NULL)) - GWI_BB(gwi_oper_add(gwi, opck_dict_each_key)) - GWI_BB(gwi_oper_end(gwi, "@each_idx", NULL)) + GWI_B(gwi_oper_ini(gwi, "Dict", NULL, NULL)) + GWI_B(gwi_oper_add(gwi, opck_dict_each_key)) + GWI_B(gwi_oper_end(gwi, "@each_idx", NULL)) - GWI_BB(gwi_func_ini(gwi, "int", "hash")); - GWI_BB(gwi_func_arg(gwi, "int", "key")); - GWI_BB(gwi_func_end(gwi, mfun_int_h, ae_flag_none)); + GWI_B(gwi_func_ini(gwi, "int", "hash")); + GWI_B(gwi_func_arg(gwi, "int", "key")); + GWI_B(gwi_func_end(gwi, mfun_int_h, ae_flag_none)); - GWI_BB(gwi_func_ini(gwi, "int", "hash")); - GWI_BB(gwi_func_arg(gwi, "Object", "key")); - GWI_BB(gwi_func_end(gwi, mfun_int_h, ae_flag_none)); + GWI_B(gwi_func_ini(gwi, "int", "hash")); + GWI_B(gwi_func_arg(gwi, "Object", "key")); + GWI_B(gwi_func_end(gwi, mfun_int_h, ae_flag_none)); - GWI_BB(gwi_func_ini(gwi, "int", "hash")); - GWI_BB(gwi_func_arg(gwi, "float", "key")); - GWI_BB(gwi_func_end(gwi, mfun_float_h, ae_flag_none)); + GWI_B(gwi_func_ini(gwi, "int", "hash")); + GWI_B(gwi_func_arg(gwi, "float", "key")); + GWI_B(gwi_func_end(gwi, mfun_float_h, ae_flag_none)); - GWI_BB(gwi_func_ini(gwi, "int", "hash")); - GWI_BB(gwi_func_arg(gwi, "time", "key")); - GWI_BB(gwi_func_end(gwi, mfun_float_h, ae_flag_none)); + GWI_B(gwi_func_ini(gwi, "int", "hash")); + GWI_B(gwi_func_arg(gwi, "time", "key")); + GWI_B(gwi_func_end(gwi, mfun_float_h, ae_flag_none)); - GWI_BB(gwi_func_ini(gwi, "int", "hash")); - GWI_BB(gwi_func_arg(gwi, "dur", "key")); - GWI_BB(gwi_func_end(gwi, mfun_float_h, ae_flag_none)); + GWI_B(gwi_func_ini(gwi, "int", "hash")); + GWI_B(gwi_func_arg(gwi, "dur", "key")); + GWI_B(gwi_func_end(gwi, mfun_float_h, ae_flag_none)); - GWI_BB(gwi_func_ini(gwi, "int", "hash")); - GWI_BB(gwi_func_arg(gwi, "string", "key")); - GWI_BB(gwi_func_end(gwi, mfun_string_h, ae_flag_none)); + GWI_B(gwi_func_ini(gwi, "int", "hash")); + GWI_B(gwi_func_arg(gwi, "string", "key")); + GWI_B(gwi_func_end(gwi, mfun_string_h, ae_flag_none)); return GW_OK; } diff --git a/src/lib/engine.c b/src/lib/engine.c index a3a744b2..1343145f 100644 --- a/src/lib/engine.c +++ b/src/lib/engine.c @@ -45,7 +45,7 @@ static FREEARG(freearg_release) { vector_release(&v); } -ANN static m_bool import_core_libs(const Gwi gwi) { +ANN static bool import_core_libs(const Gwi gwi) { gwidoc(gwi, "one type to rule them all."); const Type t_class = gwi_mk_type(gwi, "Class", SZ_INT, NULL); set_tflag(t_class, tflag_infer); @@ -123,34 +123,34 @@ ANN static m_bool import_core_libs(const Gwi gwi) { GWI_BB(gwimport_event(gwi)) GWI_BB(gwimport_ugen(gwi)) GWI_BB(gwimport_xork(gwi)) - GWI_BB(gwi_oper_ini(gwi, NULL, (m_str)OP_ANY_TYPE, NULL)) - GWI_BB(gwi_oper_add(gwi, opck_new)) - GWI_BB(gwi_oper_emi(gwi, opem_new)) - GWI_BB(gwi_oper_end(gwi, "new", NULL)) + GWI_B(gwi_oper_ini(gwi, NULL, (m_str)OP_ANY_TYPE, NULL)) + GWI_B(gwi_oper_add(gwi, opck_new)) + GWI_B(gwi_oper_emi(gwi, opem_new)) + GWI_B(gwi_oper_end(gwi, "new", NULL)) GWI_BB(gwimport_ref(gwi)) GWI_BB(gwimport_string(gwi)) GWI_BB(gwimport_shred(gwi)) GWI_BB(gwimport_modules(gwi)) gwidoc(gwi, "allow member access."); - GWI_BB(gwi_oper_ini(gwi, "@Compound", (m_str)OP_ANY_TYPE, NULL)) - GWI_BB(gwi_oper_add(gwi, opck_object_dot)) - GWI_BB(gwi_oper_emi(gwi, opem_object_dot)) - GWI_BB(gwi_oper_end(gwi, ".", NULL)) + GWI_B(gwi_oper_ini(gwi, "@Compound", (m_str)OP_ANY_TYPE, NULL)) + GWI_B(gwi_oper_add(gwi, opck_object_dot)) + GWI_B(gwi_oper_emi(gwi, opem_object_dot)) + GWI_B(gwi_oper_end(gwi, ".", NULL)) // allow const generics in functions - GWI_BB(gwi_oper_ini(gwi, "function", (m_str)OP_ANY_TYPE, NULL)) - GWI_BB(gwi_oper_add(gwi, opck_object_dot)) - GWI_BB(gwi_oper_emi(gwi, opem_object_dot)) - GWI_BB(gwi_oper_end(gwi, ".", NULL)) + GWI_B(gwi_oper_ini(gwi, "function", (m_str)OP_ANY_TYPE, NULL)) + GWI_B(gwi_oper_add(gwi, opck_object_dot)) + GWI_B(gwi_oper_emi(gwi, opem_object_dot)) + GWI_B(gwi_oper_end(gwi, ".", NULL)) GWI_BB(gwimport_class(gwi)) gwidoc(gwi, "allow static access."); - GWI_BB(gwi_oper_ini(gwi, "Class", (m_str)OP_ANY_TYPE, NULL)) - GWI_BB(gwi_oper_add(gwi, opck_object_dot)) - GWI_BB(gwi_oper_emi(gwi, opem_object_dot)) - GWI_BB(gwi_oper_end(gwi, ".", NULL)) + GWI_B(gwi_oper_ini(gwi, "Class", (m_str)OP_ANY_TYPE, NULL)) + GWI_B(gwi_oper_add(gwi, opck_object_dot)) + GWI_B(gwi_oper_emi(gwi, opem_object_dot)) + GWI_B(gwi_oper_end(gwi, ".", NULL)) GWI_BB(gwimport_deep_equal(gwi)); GWI_BB(gwimport_dict(gwi)); @@ -166,13 +166,13 @@ ANN static m_bool import_core_libs(const Gwi gwi) { gwi_register_freearg(gwi, ObjectRelease2, freearg_release); - return GW_OK; + return true; } -ANN m_bool type_engine_init(const Gwion gwion) { +ANN bool type_engine_init(const Gwion gwion) { gwion->env->name = "[builtin]"; - CHECK_b(gwi_run(gwion, import_core_libs)); + CHECK_B(gwi_run(gwion, import_core_libs)); gwion->data->cdoc = false; push_global(gwion, "[user]"); - return GW_OK; + return true; } diff --git a/src/lib/event.c b/src/lib/event.c index 2dbab34b..11483f60 100644 --- a/src/lib/event.c +++ b/src/lib/event.c @@ -54,12 +54,12 @@ GWION_IMPORT(event) { gwi_class_xtor(gwi, event_ctor, event_dtor); gwi->gwion->type[et_event] = t_event; // use func t_event->nspc->offset += SZ_INT; - GWI_BB(gwi_func_ini(gwi, "void", "signal")) - GWI_BB(gwi_func_end(gwi, event_signal, ae_flag_none)) - GWI_BB(gwi_func_ini(gwi, "void", "broadcast")) - GWI_BB(gwi_func_end(gwi, event_broadcast, ae_flag_none)) - GWI_BB(gwi_class_end(gwi)) - GWI_BB(gwi_oper_ini(gwi, "Event", "@now", "int")) - GWI_BB(gwi_oper_end(gwi, "=>", EventWait)) + GWI_B(gwi_func_ini(gwi, "void", "signal")) + GWI_B(gwi_func_end(gwi, event_signal, ae_flag_none)) + GWI_B(gwi_func_ini(gwi, "void", "broadcast")) + GWI_B(gwi_func_end(gwi, event_broadcast, ae_flag_none)) + GWI_B(gwi_class_end(gwi)) + GWI_B(gwi_oper_ini(gwi, "Event", "@now", "int")) + GWI_B(gwi_oper_end(gwi, "=>", EventWait)) return GW_OK; } diff --git a/src/lib/lib_class.c b/src/lib/lib_class.c index 9f8273c0..fb1dbd57 100644 --- a/src/lib/lib_class.c +++ b/src/lib/lib_class.c @@ -55,29 +55,29 @@ static OP_CHECK(opck_implicit_class) { GWION_IMPORT(class) { gwidoc(gwi, "Operators class types."); - GWI_BB(gwi_oper_ini(gwi, "Class", "Class", "bool")) - GWI_BB(gwi_oper_end(gwi, "==", int_eq)) - GWI_BB(gwi_oper_end(gwi, "!=", int_neq)) - GWI_BB(gwi_oper_end(gwi, ">=", instr_class_ge)) - GWI_BB(gwi_oper_end(gwi, ">", instr_class_gt)) - GWI_BB(gwi_oper_end(gwi, "<=", instr_class_le)) - GWI_BB(gwi_oper_end(gwi, "<", instr_class_lt)) + GWI_B(gwi_oper_ini(gwi, "Class", "Class", "bool")) + GWI_B(gwi_oper_end(gwi, "==", int_eq)) + GWI_B(gwi_oper_end(gwi, "!=", int_neq)) + GWI_B(gwi_oper_end(gwi, ">=", instr_class_ge)) + GWI_B(gwi_oper_end(gwi, ">", instr_class_gt)) + GWI_B(gwi_oper_end(gwi, "<=", instr_class_le)) + GWI_B(gwi_oper_end(gwi, "<", instr_class_lt)) gwidoc(gwi, "Allow binary call to constructors."); - GWI_BB(gwi_oper_ini(gwi, (m_str)OP_ANY_TYPE, "Class", NULL)) - GWI_BB(gwi_oper_add(gwi, opck_class_call)) - GWI_BB(gwi_oper_end(gwi, "=>", NULL)) + GWI_B(gwi_oper_ini(gwi, (m_str)OP_ANY_TYPE, "Class", NULL)) + GWI_B(gwi_oper_add(gwi, opck_class_call)) + GWI_B(gwi_oper_end(gwi, "=>", NULL)) gwidoc(gwi, "internal constructor operator."); - GWI_BB(gwi_oper_ini(gwi, NULL, (m_str)OP_ANY_TYPE, NULL)) - GWI_BB(gwi_oper_add(gwi, opck_basic_ctor)) - GWI_BB(gwi_oper_end(gwi, "call_type", NULL)) + GWI_B(gwi_oper_ini(gwi, NULL, (m_str)OP_ANY_TYPE, NULL)) + GWI_B(gwi_oper_add(gwi, opck_basic_ctor)) + GWI_B(gwi_oper_end(gwi, "call_type", NULL)) /* gwidoc(gwi, "Allow enum for array size"); - GWI_BB(gwi_oper_ini(gwi, "Class", "int", NULL)) - GWI_BB(gwi_oper_add(gwi, opck_implicit_class)) - GWI_BB(gwi_oper_emi(gwi, opem_implicit_class)) - GWI_BB(gwi_oper_end(gwi, "@implicit", NULL)) + GWI_B(gwi_oper_ini(gwi, "Class", "int", NULL)) + GWI_B(gwi_oper_add(gwi, opck_implicit_class)) + GWI_B(gwi_oper_emi(gwi, opem_implicit_class)) + GWI_B(gwi_oper_end(gwi, "@implicit", NULL)) */ return GW_OK; } diff --git a/src/lib/lib_gack.c b/src/lib/lib_gack.c index 002de79b..83b68ede 100644 --- a/src/lib/lib_gack.c +++ b/src/lib/lib_gack.c @@ -46,10 +46,10 @@ GWION_IMPORT(gack) { GWI_BB(gwi_set_global_type(gwi, t_gack, et_gack)); gwidoc(gwi, "@Gack implicit cast"); - GWI_BB(gwi_oper_ini(gwi, "@Gack", (m_str)OP_ANY_TYPE, NULL)) - GWI_BB(gwi_oper_add(gwi, opck_gack_implicit)) - GWI_BB(gwi_oper_emi(gwi, opem_gack_implicit)) - GWI_BB(gwi_oper_end(gwi, "@implicit", NULL)) + GWI_B(gwi_oper_ini(gwi, "@Gack", (m_str)OP_ANY_TYPE, NULL)) + GWI_B(gwi_oper_add(gwi, opck_gack_implicit)) + GWI_B(gwi_oper_emi(gwi, opem_gack_implicit)) + GWI_B(gwi_oper_end(gwi, "@implicit", NULL)) return GW_OK; } diff --git a/src/lib/locale.c b/src/lib/locale.c index b4cdc7c1..08e5a152 100644 --- a/src/lib/locale.c +++ b/src/lib/locale.c @@ -44,8 +44,8 @@ static SFUN(BasicLocale) { GWION_IMPORT(locale) { gwidoc(gwi, "Definition of the basic locale"); - GWI_BB(gwi_func_ini(gwi, "float", "BasicLocale")); - GWI_BB(gwi_func_arg(gwi, "string", "str")); - GWI_BB(gwi_func_end(gwi, BasicLocale, ae_flag_none)); + GWI_B(gwi_func_ini(gwi, "float", "BasicLocale")); + GWI_B(gwi_func_arg(gwi, "string", "str")); + GWI_B(gwi_func_end(gwi, BasicLocale, ae_flag_none)); return GW_OK; } diff --git a/src/lib/modules.c b/src/lib/modules.c index 4d22542f..a97944fa 100644 --- a/src/lib/modules.c +++ b/src/lib/modules.c @@ -38,10 +38,10 @@ static GWION_IMPORT(gain) { GWI_OB(gwi_class_ini(gwi, "Gain", "UGen")) gwi_class_xtor(gwi, gain_ctor, basic_dtor); gwi_func_ini(gwi, "float", "gain"); - GWI_BB(gwi_func_end(gwi, gain_get_gain, ae_flag_none)) + GWI_B(gwi_func_end(gwi, gain_get_gain, ae_flag_none)) gwi_func_ini(gwi, "float", "gain"); gwi_func_arg(gwi, "float", "arg0"); - GWI_BB(gwi_func_end(gwi, gain_set_gain, ae_flag_none)) + GWI_B(gwi_func_end(gwi, gain_set_gain, ae_flag_none)) return gwi_class_end(gwi); } @@ -70,10 +70,10 @@ static GWION_IMPORT(impulse) { GWI_OB(gwi_class_ini(gwi, "Impulse", "UGen")) gwi_class_xtor(gwi, impulse_ctor, basic_dtor); gwi_func_ini(gwi, "float", "next"); - GWI_BB(gwi_func_end(gwi, impulse_get_next, ae_flag_none)) + GWI_B(gwi_func_end(gwi, impulse_get_next, ae_flag_none)) gwi_func_ini(gwi, "float", "next"); gwi_func_arg(gwi, "float", "arg0"); - GWI_BB(gwi_func_end(gwi, impulse_set_next, ae_flag_none)) + GWI_B(gwi_func_end(gwi, impulse_set_next, ae_flag_none)) return gwi_class_end(gwi); } @@ -134,10 +134,10 @@ static GWION_IMPORT(step) { GWI_OB(gwi_class_ini(gwi, "Step", "UGen")) gwi_class_xtor(gwi, step_ctor, basic_dtor); gwi_func_ini(gwi, "float", "next"); - GWI_BB(gwi_func_end(gwi, step_get_next, ae_flag_none)) + GWI_B(gwi_func_end(gwi, step_get_next, ae_flag_none)) gwi_func_ini(gwi, "float", "next"); gwi_func_arg(gwi, "float", "arg0"); - GWI_BB(gwi_func_end(gwi, step_set_next, ae_flag_none)) + GWI_B(gwi_func_end(gwi, step_set_next, ae_flag_none)) return gwi_class_end(gwi); } @@ -275,13 +275,13 @@ static OP_EMIT(opem_usrugen) { static GWION_IMPORT(usrugen) { GWI_OB(gwi_class_ini(gwi, "UsrUGen", "UGen")) gwi_class_xtor(gwi, usrugen_ctor, usrugen_dtor); - GWI_BB(gwi_func_ini(gwi, "int", "default_tick")) - GWI_BB(gwi_func_end(gwi, default_tick, 0)) - GWI_BB(gwi_class_end(gwi)) - GWI_BB(gwi_oper_ini(gwi, "function", "UsrUGen", "UsrUGen")) - GWI_BB(gwi_oper_add(gwi, opck_usrugen)) - GWI_BB(gwi_oper_emi(gwi, opem_usrugen)) - GWI_BB(gwi_oper_end(gwi, "~=>", NULL)) + GWI_B(gwi_func_ini(gwi, "int", "default_tick")) + GWI_B(gwi_func_end(gwi, default_tick, 0)) + GWI_B(gwi_class_end(gwi)) + GWI_B(gwi_oper_ini(gwi, "function", "UsrUGen", "UsrUGen")) + GWI_B(gwi_oper_add(gwi, opck_usrugen)) + GWI_B(gwi_oper_emi(gwi, opem_usrugen)) + GWI_B(gwi_oper_end(gwi, "~=>", NULL)) return GW_OK; } diff --git a/src/lib/object_op.c b/src/lib/object_op.c index aa8dd1e7..15aed3f7 100644 --- a/src/lib/object_op.c +++ b/src/lib/object_op.c @@ -182,7 +182,7 @@ ANN static inline Value get_value(const Env env, const Exp_Dot *member, return NULL; } -ANN static m_bool member_access(const Env env, Exp* exp, const Value value) { +ANN static bool member_access(const Env env, Exp* exp, const Value value) { if (!env->class_def || isa(env->class_def, value->from->owner_class) < 0) { if (GET_FLAG(value, private)) { gwerr_basic("invalid variable access", "is private", NULL, env->name, @@ -190,10 +190,11 @@ ANN static m_bool member_access(const Env env, Exp* exp, const Value value) { env_error_footer(env); defined_here(value); env_set_error(env, true); + return false; } else if (GET_FLAG(value, protect)) exp_setprot(exp, 1); } - return GW_OK; + return true; } OP_CHECK(opck_object_dot) { @@ -218,7 +219,7 @@ OP_CHECK(opck_object_dot) { return env->gwion->type[et_error]; } CHECK_ON(not_from_owner_class(env, the_base, value, self->loc)); - CHECK_BN(member_access(env, self, value)); + CHECK_ON(member_access(env, self, value)); if ((base_static && vflag(value, vflag_member)) || (value->from->owner_class != env->class_def && isa(value->from->owner_class, env->class_def) > 0)) ERR_N(self->loc, @@ -379,28 +380,28 @@ GWION_IMPORT(object_op) { const Type t_error = gwi_mk_type(gwi, "@error", 0, NULL); gwi->gwion->type[et_error] = t_error; GWI_BB(gwi_set_global_type(gwi, t_error, et_error)) - GWI_BB(gwi_oper_ini(gwi, "Object", "Object", NULL)) - GWI_BB(gwi_oper_add(gwi, opck_object_at)) - GWI_BB(gwi_oper_emi(gwi, opem_object_at)) - GWI_BB(gwi_oper_end(gwi, ":=>", NULL)) - GWI_BB(gwi_oper_ini(gwi, (m_str)OP_ANY_TYPE, "@Compound", NULL)) - GWI_BB(gwi_oper_add(gwi, opck_object_instance)) - GWI_BB(gwi_oper_end(gwi, "=>", NULL)) - GWI_BB(gwi_oper_ini(gwi, "Object", "Object", "bool")) - GWI_BB(gwi_oper_end(gwi, "==", EqObject)) - GWI_BB(gwi_oper_end(gwi, "!=", NeqObject)) - GWI_BB(gwi_oper_add(gwi, opck_object_cast)) - GWI_BB(gwi_oper_end(gwi, "$", NULL)) - GWI_BB(gwi_oper_ini(gwi, NULL, "Object", "bool")) - GWI_BB(gwi_oper_emi(gwi, opem_uncond_object)) - GWI_BB(gwi_oper_end(gwi, "@unconditional", NULL)) - GWI_BB(gwi_oper_emi(gwi, opem_cond_object)) - GWI_BB(gwi_oper_end(gwi, "@conditional", NULL)) - GWI_BB(gwi_oper_add(gwi, opck_unary_meta2)) - GWI_BB(gwi_oper_emi(gwi, opem_not_object)) - GWI_BB(gwi_oper_end(gwi, "!", NULL)) - GWI_BB(gwi_oper_ini(gwi, "@Compound", NULL, NULL)) - GWI_BB(gwi_oper_add(gwi, opck_struct_scan)) - GWI_BB(gwi_oper_end(gwi, "class", NULL)) + GWI_B(gwi_oper_ini(gwi, "Object", "Object", NULL)) + GWI_B(gwi_oper_add(gwi, opck_object_at)) + GWI_B(gwi_oper_emi(gwi, opem_object_at)) + GWI_B(gwi_oper_end(gwi, ":=>", NULL)) + GWI_B(gwi_oper_ini(gwi, (m_str)OP_ANY_TYPE, "@Compound", NULL)) + GWI_B(gwi_oper_add(gwi, opck_object_instance)) + GWI_B(gwi_oper_end(gwi, "=>", NULL)) + GWI_B(gwi_oper_ini(gwi, "Object", "Object", "bool")) + GWI_B(gwi_oper_end(gwi, "==", EqObject)) + GWI_B(gwi_oper_end(gwi, "!=", NeqObject)) + GWI_B(gwi_oper_add(gwi, opck_object_cast)) + GWI_B(gwi_oper_end(gwi, "$", NULL)) + GWI_B(gwi_oper_ini(gwi, NULL, "Object", "bool")) + GWI_B(gwi_oper_emi(gwi, opem_uncond_object)) + GWI_B(gwi_oper_end(gwi, "@unconditional", NULL)) + GWI_B(gwi_oper_emi(gwi, opem_cond_object)) + GWI_B(gwi_oper_end(gwi, "@conditional", NULL)) + GWI_B(gwi_oper_add(gwi, opck_unary_meta2)) + GWI_B(gwi_oper_emi(gwi, opem_not_object)) + GWI_B(gwi_oper_end(gwi, "!", NULL)) + GWI_B(gwi_oper_ini(gwi, "@Compound", NULL, NULL)) + GWI_B(gwi_oper_add(gwi, opck_struct_scan)) + GWI_B(gwi_oper_end(gwi, "class", NULL)) return GW_OK; } diff --git a/src/lib/prim.c b/src/lib/prim.c index 1439d139..cba312dc 100644 --- a/src/lib/prim.c +++ b/src/lib/prim.c @@ -118,12 +118,12 @@ BINARY_INT_EMIT(gt) BINARY_INT_EMIT(ge) #define IMPORT_BINARY_INT(name, op) \ - GWI_BB(gwi_oper_add(gwi, opck_int_##name)) \ - GWI_BB(gwi_oper_emi(gwi, opem_int_##name)) \ - GWI_BB(gwi_oper_end(gwi, #op, NULL)) + GWI_B(gwi_oper_add(gwi, opck_int_##name)) \ + GWI_B(gwi_oper_emi(gwi, opem_int_##name)) \ + GWI_B(gwi_oper_end(gwi, #op, NULL)) GWION_IMPORT(int_op) { - GWI_BB(gwi_oper_ini(gwi, "int", "int", "int")) + GWI_B(gwi_oper_ini(gwi, "int", "int", "int")) IMPORT_BINARY_INT(add, +) IMPORT_BINARY_INT(sub, -) IMPORT_BINARY_INT(mul, *) @@ -133,34 +133,34 @@ GWION_IMPORT(int_op) { } static GWION_IMPORT(int_logical) { - GWI_BB(gwi_oper_ini(gwi, "int", "int", "int")) + GWI_B(gwi_oper_ini(gwi, "int", "int", "int")) IMPORT_BINARY_INT(gt, >) IMPORT_BINARY_INT(ge, >=) IMPORT_BINARY_INT(lt, <) IMPORT_BINARY_INT(le, <=) - GWI_BB(gwi_oper_add(gwi, opck_int_sr)) - GWI_BB(gwi_oper_end(gwi, ">>", int_sr)) - GWI_BB(gwi_oper_add(gwi, opck_int_sl)) - GWI_BB(gwi_oper_end(gwi, "<<", int_sl)) - GWI_BB(gwi_oper_add(gwi, opck_int_sand)) - GWI_BB(gwi_oper_end(gwi, "&", int_sand)) - GWI_BB(gwi_oper_add(gwi, opck_int_sor)) - GWI_BB(gwi_oper_end(gwi, "|", int_sor)) - GWI_BB(gwi_oper_add(gwi, opck_int_xor)) - GWI_BB(gwi_oper_end(gwi, "^", int_xor)) - GWI_BB(gwi_oper_ini(gwi, "int", "int", "bool")) - GWI_BB(gwi_oper_add(gwi, opck_int_and)) - GWI_BB(gwi_oper_end(gwi, "&&", int_and)) - GWI_BB(gwi_oper_add(gwi, opck_int_or)) - GWI_BB(gwi_oper_end(gwi, "||", int_or)) - GWI_BB(gwi_oper_add(gwi, opck_int_eq)) - GWI_BB(gwi_oper_end(gwi, "==", int_eq)) - GWI_BB(gwi_oper_add(gwi, opck_int_neq)) + GWI_B(gwi_oper_add(gwi, opck_int_sr)) + GWI_B(gwi_oper_end(gwi, ">>", int_sr)) + GWI_B(gwi_oper_add(gwi, opck_int_sl)) + GWI_B(gwi_oper_end(gwi, "<<", int_sl)) + GWI_B(gwi_oper_add(gwi, opck_int_sand)) + GWI_B(gwi_oper_end(gwi, "&", int_sand)) + GWI_B(gwi_oper_add(gwi, opck_int_sor)) + GWI_B(gwi_oper_end(gwi, "|", int_sor)) + GWI_B(gwi_oper_add(gwi, opck_int_xor)) + GWI_B(gwi_oper_end(gwi, "^", int_xor)) + GWI_B(gwi_oper_ini(gwi, "int", "int", "bool")) + GWI_B(gwi_oper_add(gwi, opck_int_and)) + GWI_B(gwi_oper_end(gwi, "&&", int_and)) + GWI_B(gwi_oper_add(gwi, opck_int_or)) + GWI_B(gwi_oper_end(gwi, "||", int_or)) + GWI_B(gwi_oper_add(gwi, opck_int_eq)) + GWI_B(gwi_oper_end(gwi, "==", int_eq)) + GWI_B(gwi_oper_add(gwi, opck_int_neq)) return gwi_oper_end(gwi, "!=", int_neq); } static GWION_IMPORT(int_r) { - GWI_BB(gwi_oper_ini(gwi, "int", "int", "int")) + GWI_B(gwi_oper_ini(gwi, "int", "int", "int")) CHECK_OP(":=>", rassign, r_assign) CHECK_OP("+=>", rassign, r_plus) CHECK_OP("-=>", rassign, r_minus) @@ -225,24 +225,24 @@ UNARY_INT_FOLD(cmp, unary->exp->type, ~) UNARY_INT_FOLD(not, FOLD_BOOL, !) static GWION_IMPORT(int_unary) { - GWI_BB(gwi_oper_ini(gwi, NULL, "int", "int")) - GWI_BB(gwi_oper_add(gwi, opck_int_negate)) - GWI_BB(gwi_oper_end(gwi, "-", int_negate)) - GWI_BB(gwi_oper_add(gwi, opck_unary)) - GWI_BB(gwi_oper_end(gwi, "++", int_pre_inc)) - GWI_BB(gwi_oper_add(gwi, opck_unary)) - GWI_BB(gwi_oper_end(gwi, "--", int_pre_dec)) - GWI_BB(gwi_oper_add(gwi, opck_int_cmp)) - GWI_BB(gwi_oper_end(gwi, "~", int_cmp)) - GWI_BB(gwi_oper_ini(gwi, "int", NULL, NULL)) - GWI_BB(gwi_oper_add(gwi, opck_int_range)) - GWI_BB(gwi_oper_emi(gwi, opem_int_range)) - GWI_BB(gwi_oper_end(gwi, "[:]", NULL)) - GWI_BB(gwi_oper_ini(gwi, "int", NULL, "int")) - GWI_BB(gwi_oper_add(gwi, opck_post)) - GWI_BB(gwi_oper_end(gwi, "++", int_post_inc)) - GWI_BB(gwi_oper_add(gwi, opck_post)) - GWI_BB(gwi_oper_end(gwi, "--", int_post_dec)) + GWI_B(gwi_oper_ini(gwi, NULL, "int", "int")) + GWI_B(gwi_oper_add(gwi, opck_int_negate)) + GWI_B(gwi_oper_end(gwi, "-", int_negate)) + GWI_B(gwi_oper_add(gwi, opck_unary)) + GWI_B(gwi_oper_end(gwi, "++", int_pre_inc)) + GWI_B(gwi_oper_add(gwi, opck_unary)) + GWI_B(gwi_oper_end(gwi, "--", int_pre_dec)) + GWI_B(gwi_oper_add(gwi, opck_int_cmp)) + GWI_B(gwi_oper_end(gwi, "~", int_cmp)) + GWI_B(gwi_oper_ini(gwi, "int", NULL, NULL)) + GWI_B(gwi_oper_add(gwi, opck_int_range)) + GWI_B(gwi_oper_emi(gwi, opem_int_range)) + GWI_B(gwi_oper_end(gwi, "[:]", NULL)) + GWI_B(gwi_oper_ini(gwi, "int", NULL, "int")) + GWI_B(gwi_oper_add(gwi, opck_post)) + GWI_B(gwi_oper_end(gwi, "++", int_post_inc)) + GWI_B(gwi_oper_add(gwi, opck_post)) + GWI_B(gwi_oper_end(gwi, "--", int_post_dec)) return GW_OK; } static GACK(gack_bool) { @@ -268,13 +268,13 @@ static GWION_IMPORT(int_values) { gwi_item_end(gwi, ae_flag_const, num, 1); gwi_item_ini(gwi, "bool", "false"); gwi_item_end(gwi, ae_flag_const, num, 0); - GWI_BB(gwi_oper_ini(gwi, NULL, "int", "bool")) - GWI_BB(gwi_oper_add(gwi, opck_unary_meta)) - GWI_BB(gwi_oper_add(gwi, opck_int_not)) - GWI_BB(gwi_oper_end(gwi, "!", IntNot)) - GWI_BB(gwi_oper_ini(gwi, "bool", "float", NULL)) - GWI_BB(gwi_oper_add(gwi, bool2float)); - GWI_BB(gwi_oper_end(gwi, "@implicit", NULL)) + GWI_B(gwi_oper_ini(gwi, NULL, "int", "bool")) + GWI_B(gwi_oper_add(gwi, opck_unary_meta)) + GWI_B(gwi_oper_add(gwi, opck_int_not)) + GWI_B(gwi_oper_end(gwi, "!", IntNot)) + GWI_B(gwi_oper_ini(gwi, "bool", "float", NULL)) + GWI_B(gwi_oper_add(gwi, bool2float)); + GWI_B(gwi_oper_end(gwi, "@implicit", NULL)) struct SpecialId_ spid = { .type = t_bool, .exec = RegPushMaybe, .is_const = 1}; gwi_specialid(gwi, "maybe", &spid); @@ -283,8 +283,8 @@ static GWION_IMPORT(int_values) { static GWION_IMPORT(int) { GWI_BB(gwimport_int_values(gwi)) - GWI_BB(gwi_oper_cond(gwi, "int", BranchEqInt, BranchNeqInt)) - GWI_BB(gwi_oper_ini(gwi, "int", "int", "int")) + GWI_B(gwi_oper_cond(gwi, "int", BranchEqInt, BranchNeqInt)) + GWI_B(gwi_oper_ini(gwi, "int", "int", "int")) GWI_BB(gwimport_int_op(gwi)) GWI_BB(gwimport_int_logical(gwi)) GWI_BB(gwimport_int_r(gwi)) @@ -359,24 +359,24 @@ BINARY_INT_FLOAT_FOLD2(eq, FOLD_BOOL, ==,) BINARY_INT_FLOAT_FOLD2(neq, FOLD_BOOL, !=,) static GWION_IMPORT(intfloat) { - GWI_BB(gwi_oper_ini(gwi, "int", "float", "int")) - GWI_BB(gwi_oper_add(gwi, opck_int_float_gt)) - GWI_BB(gwi_oper_end(gwi, ">", int_float_gt)) - GWI_BB(gwi_oper_add(gwi, opck_int_float_ge)) - GWI_BB(gwi_oper_end(gwi, ">=", int_float_ge)) - GWI_BB(gwi_oper_add(gwi, opck_int_float_lt)) - GWI_BB(gwi_oper_end(gwi, "<", int_float_lt)) - GWI_BB(gwi_oper_add(gwi, opck_int_float_le)) - GWI_BB(gwi_oper_end(gwi, "<=", int_float_le)) - GWI_BB(gwi_oper_ini(gwi, "int", "float", "float")) - GWI_BB(gwi_oper_add(gwi, opck_int_float_add)) - GWI_BB(gwi_oper_end(gwi, "+", int_float_plus)) - GWI_BB(gwi_oper_add(gwi, opck_int_float_mul)) - GWI_BB(gwi_oper_end(gwi, "*", int_float_mul)) - GWI_BB(gwi_oper_add(gwi, opck_int_float_sub)) - GWI_BB(gwi_oper_end(gwi, "-", int_float_minus)) - GWI_BB(gwi_oper_add(gwi, opck_int_float_div)) - GWI_BB(gwi_oper_end(gwi, "/", int_float_div)) + GWI_B(gwi_oper_ini(gwi, "int", "float", "int")) + GWI_B(gwi_oper_add(gwi, opck_int_float_gt)) + GWI_B(gwi_oper_end(gwi, ">", int_float_gt)) + GWI_B(gwi_oper_add(gwi, opck_int_float_ge)) + GWI_B(gwi_oper_end(gwi, ">=", int_float_ge)) + GWI_B(gwi_oper_add(gwi, opck_int_float_lt)) + GWI_B(gwi_oper_end(gwi, "<", int_float_lt)) + GWI_B(gwi_oper_add(gwi, opck_int_float_le)) + GWI_B(gwi_oper_end(gwi, "<=", int_float_le)) + GWI_B(gwi_oper_ini(gwi, "int", "float", "float")) + GWI_B(gwi_oper_add(gwi, opck_int_float_add)) + GWI_B(gwi_oper_end(gwi, "+", int_float_plus)) + GWI_B(gwi_oper_add(gwi, opck_int_float_mul)) + GWI_B(gwi_oper_end(gwi, "*", int_float_mul)) + GWI_B(gwi_oper_add(gwi, opck_int_float_sub)) + GWI_B(gwi_oper_end(gwi, "-", int_float_minus)) + GWI_B(gwi_oper_add(gwi, opck_int_float_div)) + GWI_B(gwi_oper_end(gwi, "/", int_float_div)) CHECK_IF(":=>", rassign, r_assign) CHECK_IF("+=>", rassign, r_plus) CHECK_IF("-=>", rassign, r_minus) @@ -384,15 +384,15 @@ static GWION_IMPORT(intfloat) { CHECK_IF("/=>", rassign, r_div) _CHECK_OP("$", cast_i2f, CastI2F) _CHECK_OP("@implicit", implicit_i2f, CastI2F) - GWI_BB(gwi_oper_ini(gwi, "int", "float", "bool")) - GWI_BB(gwi_oper_add(gwi, opck_int_float_and)) - GWI_BB(gwi_oper_end(gwi, "&&", int_float_and)) - GWI_BB(gwi_oper_add(gwi, opck_int_float_or)) - GWI_BB(gwi_oper_end(gwi, "||", int_float_or)) - GWI_BB(gwi_oper_add(gwi, opck_int_float_eq)) - GWI_BB(gwi_oper_end(gwi, "==", int_float_eq)) - GWI_BB(gwi_oper_add(gwi, opck_int_float_neq)) - GWI_BB(gwi_oper_end(gwi, "!=", int_float_neq)) + GWI_B(gwi_oper_ini(gwi, "int", "float", "bool")) + GWI_B(gwi_oper_add(gwi, opck_int_float_and)) + GWI_B(gwi_oper_end(gwi, "&&", int_float_and)) + GWI_B(gwi_oper_add(gwi, opck_int_float_or)) + GWI_B(gwi_oper_end(gwi, "||", int_float_or)) + GWI_B(gwi_oper_add(gwi, opck_int_float_eq)) + GWI_B(gwi_oper_end(gwi, "==", int_float_eq)) + GWI_B(gwi_oper_add(gwi, opck_int_float_neq)) + GWI_B(gwi_oper_end(gwi, "!=", int_float_neq)) return GW_OK; } @@ -423,70 +423,70 @@ BINARY_FLOAT_INT_FOLD2(eq, FOLD_BOOL, ==,) BINARY_FLOAT_INT_FOLD2(neq, FOLD_BOOL, !=,) static GWION_IMPORT(floatint) { - GWI_BB(gwi_oper_ini(gwi, "float", "int", "float")) - GWI_BB(gwi_oper_add(gwi, opck_float_int_add)) - GWI_BB(gwi_oper_end(gwi, "+", float_int_plus)) - GWI_BB(gwi_oper_add(gwi, opck_float_int_sub)) - GWI_BB(gwi_oper_end(gwi, "-", float_int_minus)) - GWI_BB(gwi_oper_add(gwi, opck_float_int_mul)) - GWI_BB(gwi_oper_end(gwi, "*", float_int_mul)) - GWI_BB(gwi_oper_add(gwi, opck_float_int_div)) - GWI_BB(gwi_oper_end(gwi, "/", float_int_div)) + GWI_B(gwi_oper_ini(gwi, "float", "int", "float")) + GWI_B(gwi_oper_add(gwi, opck_float_int_add)) + GWI_B(gwi_oper_end(gwi, "+", float_int_plus)) + GWI_B(gwi_oper_add(gwi, opck_float_int_sub)) + GWI_B(gwi_oper_end(gwi, "-", float_int_minus)) + GWI_B(gwi_oper_add(gwi, opck_float_int_mul)) + GWI_B(gwi_oper_end(gwi, "*", float_int_mul)) + GWI_B(gwi_oper_add(gwi, opck_float_int_div)) + GWI_B(gwi_oper_end(gwi, "/", float_int_div)) CHECK_FI(":=>", rassign, r_assign) CHECK_FI("+=>", rassign, r_plus) CHECK_FI("-=>", rassign, r_minus) CHECK_FI("*=>", rassign, r_mul) CHECK_FI("/=>", rassign, r_div) _CHECK_OP("$", cast_f2i, CastF2I) - GWI_BB(gwi_oper_ini(gwi, "float", "int", "bool")) - GWI_BB(gwi_oper_add(gwi, opck_float_int_and)) - GWI_BB(gwi_oper_end(gwi, "&&", float_int_and)) - GWI_BB(gwi_oper_add(gwi, opck_float_int_or)) - GWI_BB(gwi_oper_end(gwi, "||", float_int_or)) - GWI_BB(gwi_oper_add(gwi, opck_float_int_eq)) - GWI_BB(gwi_oper_end(gwi, "==", float_int_eq)) - GWI_BB(gwi_oper_add(gwi, opck_float_int_neq)) - GWI_BB(gwi_oper_end(gwi, "!=", float_int_neq)) - GWI_BB(gwi_oper_add(gwi, opck_float_int_gt)) - GWI_BB(gwi_oper_end(gwi, ">", float_int_gt)) - GWI_BB(gwi_oper_add(gwi, opck_float_int_ge)) - GWI_BB(gwi_oper_end(gwi, ">=", float_int_ge)) - GWI_BB(gwi_oper_add(gwi, opck_float_int_lt)) - GWI_BB(gwi_oper_end(gwi, "<", float_int_lt)) - GWI_BB(gwi_oper_add(gwi, opck_float_int_le)) - GWI_BB(gwi_oper_end(gwi, "<=", float_int_le)) + GWI_B(gwi_oper_ini(gwi, "float", "int", "bool")) + GWI_B(gwi_oper_add(gwi, opck_float_int_and)) + GWI_B(gwi_oper_end(gwi, "&&", float_int_and)) + GWI_B(gwi_oper_add(gwi, opck_float_int_or)) + GWI_B(gwi_oper_end(gwi, "||", float_int_or)) + GWI_B(gwi_oper_add(gwi, opck_float_int_eq)) + GWI_B(gwi_oper_end(gwi, "==", float_int_eq)) + GWI_B(gwi_oper_add(gwi, opck_float_int_neq)) + GWI_B(gwi_oper_end(gwi, "!=", float_int_neq)) + GWI_B(gwi_oper_add(gwi, opck_float_int_gt)) + GWI_B(gwi_oper_end(gwi, ">", float_int_gt)) + GWI_B(gwi_oper_add(gwi, opck_float_int_ge)) + GWI_B(gwi_oper_end(gwi, ">=", float_int_ge)) + GWI_B(gwi_oper_add(gwi, opck_float_int_lt)) + GWI_B(gwi_oper_end(gwi, "<", float_int_lt)) + GWI_B(gwi_oper_add(gwi, opck_float_int_le)) + GWI_B(gwi_oper_end(gwi, "<=", float_int_le)) return GW_OK; } static GWION_IMPORT(dur) { - GWI_BB(gwi_oper_cond(gwi, "dur", BranchEqFloat, BranchNeqFloat)) - GWI_BB(gwi_oper_ini(gwi, "dur", "dur", "dur")) + GWI_B(gwi_oper_cond(gwi, "dur", BranchEqFloat, BranchNeqFloat)) + GWI_B(gwi_oper_ini(gwi, "dur", "dur", "dur")) CHECK_FF(":=>", rassign, r_assign) CHECK_FF("+=>", rassign, r_plus) CHECK_FF("-=>", rassign, r_minus) CHECK_FF("*=>", rassign, r_mul) CHECK_FF("/=>", rassign, r_div) - GWI_BB(gwi_oper_end(gwi, "+", float_add)) - GWI_BB(gwi_oper_end(gwi, "-", float_sub)) - GWI_BB(gwi_oper_end(gwi, "*", float_mul)) - GWI_BB(gwi_oper_ini(gwi, "dur", "dur", "float")) - GWI_BB(gwi_oper_eff(gwi, "ZeroDivideException")) - GWI_BB(gwi_oper_end(gwi, "/", float_div)) - - GWI_BB(gwi_oper_ini(gwi, "dur", "float", "dur")) - GWI_BB(gwi_oper_eff(gwi, "ZeroDivideException")) - GWI_BB(gwi_oper_end(gwi, "/", float_div)) - - GWI_BB(gwi_oper_ini(gwi, "float", "dur", "dur")) + GWI_B(gwi_oper_end(gwi, "+", float_add)) + GWI_B(gwi_oper_end(gwi, "-", float_sub)) + GWI_B(gwi_oper_end(gwi, "*", float_mul)) + GWI_B(gwi_oper_ini(gwi, "dur", "dur", "float")) + GWI_B(gwi_oper_eff(gwi, "ZeroDivideException")) + GWI_B(gwi_oper_end(gwi, "/", float_div)) + + GWI_B(gwi_oper_ini(gwi, "dur", "float", "dur")) + GWI_B(gwi_oper_eff(gwi, "ZeroDivideException")) + GWI_B(gwi_oper_end(gwi, "/", float_div)) + + GWI_B(gwi_oper_ini(gwi, "float", "dur", "dur")) CHECK_FF("*=>", rassign, r_mul) CHECK_FF("/=>", rassign, r_div) - GWI_BB(gwi_oper_ini(gwi, "dur", "dur", "bool")) - GWI_BB(gwi_oper_end(gwi, "==", float_eq)) - GWI_BB(gwi_oper_end(gwi, "!=", float_neq)) - GWI_BB(gwi_oper_end(gwi, ">", float_gt)) - GWI_BB(gwi_oper_end(gwi, ">=", float_ge)) - GWI_BB(gwi_oper_end(gwi, "<", float_lt)) + GWI_B(gwi_oper_ini(gwi, "dur", "dur", "bool")) + GWI_B(gwi_oper_end(gwi, "==", float_eq)) + GWI_B(gwi_oper_end(gwi, "!=", float_neq)) + GWI_B(gwi_oper_end(gwi, ">", float_gt)) + GWI_B(gwi_oper_end(gwi, ">=", float_ge)) + GWI_B(gwi_oper_end(gwi, "<", float_lt)) return gwi_oper_end(gwi, "<=", float_le); } @@ -504,28 +504,28 @@ static OP_CHECK(opck_now) { } static GWION_IMPORT(time) { - GWI_BB(gwi_oper_cond(gwi, "time", BranchEqFloat, BranchNeqFloat)) - GWI_BB(gwi_oper_ini(gwi, "time", "time", "time")) + GWI_B(gwi_oper_cond(gwi, "time", BranchEqFloat, BranchNeqFloat)) + GWI_B(gwi_oper_ini(gwi, "time", "time", "time")) CHECK_FF(":=>", rassign, r_assign) - GWI_BB(gwi_oper_ini(gwi, "time", "dur", "time")) - GWI_BB(gwi_oper_end(gwi, "+", float_add)) - GWI_BB(gwi_oper_end(gwi, "*", float_mul)) - GWI_BB(gwi_oper_eff(gwi, "ZeroDivideException")) - GWI_BB(gwi_oper_end(gwi, "/", float_div)) - GWI_BB(gwi_oper_ini(gwi, "time", "time", "dur")) - GWI_BB(gwi_oper_end(gwi, "-", float_sub)) - GWI_BB(gwi_oper_ini(gwi, "float", "time", "time")) + GWI_B(gwi_oper_ini(gwi, "time", "dur", "time")) + GWI_B(gwi_oper_end(gwi, "+", float_add)) + GWI_B(gwi_oper_end(gwi, "*", float_mul)) + GWI_B(gwi_oper_eff(gwi, "ZeroDivideException")) + GWI_B(gwi_oper_end(gwi, "/", float_div)) + GWI_B(gwi_oper_ini(gwi, "time", "time", "dur")) + GWI_B(gwi_oper_end(gwi, "-", float_sub)) + GWI_B(gwi_oper_ini(gwi, "float", "time", "time")) CHECK_FF("*=>", rassign, r_mul) CHECK_FF("/=>", rassign, r_div) - GWI_BB(gwi_oper_ini(gwi, "dur", "time", "time")) + GWI_B(gwi_oper_ini(gwi, "dur", "time", "time")) CHECK_FF(":=>", rassign, r_assign) - GWI_BB(gwi_oper_end(gwi, "+", float_add)) - GWI_BB(gwi_oper_ini(gwi, "dur", "@now", "time")) + GWI_B(gwi_oper_end(gwi, "+", float_add)) + GWI_B(gwi_oper_ini(gwi, "dur", "@now", "time")) _CHECK_OP("=>", now, Time_Advance) - GWI_BB(gwi_oper_ini(gwi, "time", "time", "bool")) - GWI_BB(gwi_oper_end(gwi, ">", float_gt)) - GWI_BB(gwi_oper_end(gwi, ">=", float_ge)) - GWI_BB(gwi_oper_end(gwi, "<", float_lt)) + GWI_B(gwi_oper_ini(gwi, "time", "time", "bool")) + GWI_B(gwi_oper_end(gwi, ">", float_gt)) + GWI_B(gwi_oper_end(gwi, ">=", float_ge)) + GWI_B(gwi_oper_end(gwi, "<", float_lt)) return gwi_oper_end(gwi, "<=", float_le); } @@ -572,48 +572,48 @@ UNARY_FLOAT_FOLD(negate, unary->exp->type, -) UNARY_FLOAT_FOLD(not, FOLD_BOOL, !) #define IMPORT_BINARY_FLOAT(name, op) \ - GWI_BB(gwi_oper_add(gwi, opck_float_##name)) \ - GWI_BB(gwi_oper_emi(gwi, opem_float_##name)) \ - GWI_BB(gwi_oper_end(gwi, #op, NULL)) + GWI_B(gwi_oper_add(gwi, opck_float_##name)) \ + GWI_B(gwi_oper_emi(gwi, opem_float_##name)) \ + GWI_B(gwi_oper_end(gwi, #op, NULL)) static GWION_IMPORT(float) { - GWI_BB(gwi_oper_cond(gwi, "float", BranchEqFloat, BranchNeqFloat)) - GWI_BB(gwi_oper_ini(gwi, "float", "float", "float")) + GWI_B(gwi_oper_cond(gwi, "float", BranchEqFloat, BranchNeqFloat)) + GWI_B(gwi_oper_ini(gwi, "float", "float", "float")) IMPORT_BINARY_FLOAT(add, +); IMPORT_BINARY_FLOAT(sub, -); IMPORT_BINARY_FLOAT(mul, *); IMPORT_BINARY_FLOAT(div, /); - GWI_BB(gwi_oper_end(gwi, "@implicit", NULL)) + GWI_B(gwi_oper_end(gwi, "@implicit", NULL)) CHECK_FF(":=>", rassign, r_assign) CHECK_FF("+=>", rassign, r_plus) CHECK_FF("-=>", rassign, r_minus) CHECK_FF("*=>", rassign, r_mul) CHECK_FF("/=>", rassign, r_div) - GWI_BB(gwi_oper_ini(gwi, "float", "float", "bool")) - GWI_BB(gwi_oper_add(gwi, opck_float_and)) - GWI_BB(gwi_oper_end(gwi, "&&", float_and)) - GWI_BB(gwi_oper_add(gwi, opck_float_or)) - GWI_BB(gwi_oper_end(gwi, "||", float_or)) - GWI_BB(gwi_oper_add(gwi, opck_float_eq)) - GWI_BB(gwi_oper_end(gwi, "==", float_eq)) - GWI_BB(gwi_oper_add(gwi, opck_float_neq)) - GWI_BB(gwi_oper_end(gwi, "!=", float_neq)) + GWI_B(gwi_oper_ini(gwi, "float", "float", "bool")) + GWI_B(gwi_oper_add(gwi, opck_float_and)) + GWI_B(gwi_oper_end(gwi, "&&", float_and)) + GWI_B(gwi_oper_add(gwi, opck_float_or)) + GWI_B(gwi_oper_end(gwi, "||", float_or)) + GWI_B(gwi_oper_add(gwi, opck_float_eq)) + GWI_B(gwi_oper_end(gwi, "==", float_eq)) + GWI_B(gwi_oper_add(gwi, opck_float_neq)) + GWI_B(gwi_oper_end(gwi, "!=", float_neq)) IMPORT_BINARY_FLOAT(gt, >); IMPORT_BINARY_FLOAT(ge, >=); IMPORT_BINARY_FLOAT(lt, <); IMPORT_BINARY_FLOAT(le, <=); - GWI_BB(gwi_oper_ini(gwi, NULL, "float", "float")) + GWI_B(gwi_oper_ini(gwi, NULL, "float", "float")) // CHECK_FF("-", unary_meta, negate) - GWI_BB(gwi_oper_add(gwi, opck_float_negate)) - GWI_BB(gwi_oper_end(gwi, "-", float_negate)) - GWI_BB(gwi_oper_ini(gwi, "int", "dur", "dur")) - GWI_BB(gwi_oper_end(gwi, "::", int_float_mul)) - GWI_BB(gwi_oper_ini(gwi, "float", "dur", "dur")) - GWI_BB(gwi_oper_end(gwi, "::", float_mul)) - GWI_BB(gwi_oper_ini(gwi, NULL, "float", "bool")) - // GWI_BB(gwi_oper_add(gwi, opck_unary_meta2)) - GWI_BB(gwi_oper_add(gwi, opck_float_not)) - GWI_BB(gwi_oper_end(gwi, "!", float_not)) + GWI_B(gwi_oper_add(gwi, opck_float_negate)) + GWI_B(gwi_oper_end(gwi, "-", float_negate)) + GWI_B(gwi_oper_ini(gwi, "int", "dur", "dur")) + GWI_B(gwi_oper_end(gwi, "::", int_float_mul)) + GWI_B(gwi_oper_ini(gwi, "float", "dur", "dur")) + GWI_B(gwi_oper_end(gwi, "::", float_mul)) + GWI_B(gwi_oper_ini(gwi, NULL, "float", "bool")) + // GWI_B(gwi_oper_add(gwi, opck_unary_meta2)) + GWI_B(gwi_oper_add(gwi, opck_float_not)) + GWI_B(gwi_oper_end(gwi, "!", float_not)) return GW_OK; } diff --git a/src/lib/ref.c b/src/lib/ref.c index fa677ae1..ebe952f9 100644 --- a/src/lib/ref.c +++ b/src/lib/ref.c @@ -187,11 +187,11 @@ GWION_IMPORT(ref) { gwinote(gwi, "a pointer to the referenced variable."); t_foreach->nspc->offset += SZ_INT; - GWI_BB(gwi_struct_end(gwi)) + GWI_B(gwi_struct_end(gwi)) gwidoc(gwi, "internal `Ref` type creation."); - GWI_BB(gwi_oper_ini(gwi, "Ref", NULL, NULL)) - GWI_BB(gwi_oper_add(gwi, opck_ref_scan)) - GWI_BB(gwi_oper_end(gwi, "class", NULL)) + GWI_B(gwi_oper_ini(gwi, "Ref", NULL, NULL)) + GWI_B(gwi_oper_add(gwi, opck_ref_scan)) + GWI_B(gwi_oper_end(gwi, "class", NULL)) return GW_OK; } diff --git a/src/lib/shred.c b/src/lib/shred.c index 006f45f9..3621ebb0 100644 --- a/src/lib/shred.c +++ b/src/lib/shred.c @@ -347,66 +347,66 @@ GWION_IMPORT(shred) { GWI_BB((o_shred_cancel = gwi_item_end(gwi, ae_flag_const, num, 0))) gwi_func_ini(gwi, "void", "exit"); - GWI_BB(gwi_func_end(gwi, gw_shred_exit, ae_flag_none)) + GWI_B(gwi_func_end(gwi, gw_shred_exit, ae_flag_none)) gwi_func_ini(gwi, "bool", "running"); - GWI_BB(gwi_func_end(gwi, vm_shred_is_running, ae_flag_none)) + GWI_B(gwi_func_end(gwi, vm_shred_is_running, ae_flag_none)) gwi_func_ini(gwi, "bool", "done"); - GWI_BB(gwi_func_end(gwi, vm_shred_is_done, ae_flag_none)) + GWI_B(gwi_func_end(gwi, vm_shred_is_done, ae_flag_none)) gwi_func_ini(gwi, "int", "id"); - GWI_BB(gwi_func_end(gwi, vm_shred_id, ae_flag_none)) + GWI_B(gwi_func_end(gwi, vm_shred_id, ae_flag_none)) gwi_func_ini(gwi, "Shred", "fromId"); gwi_func_arg(gwi, "int", "xid"); - GWI_BB(gwi_func_end(gwi, vm_shred_from_id, ae_flag_static)) + GWI_B(gwi_func_end(gwi, vm_shred_from_id, ae_flag_static)) gwi_func_ini(gwi, "void", "yield"); - GWI_BB(gwi_func_end(gwi, shred_yield, ae_flag_none)) + GWI_B(gwi_func_end(gwi, shred_yield, ae_flag_none)) gwi_func_ini(gwi, "int", "args"); - GWI_BB(gwi_func_end(gwi, shred_args, ae_flag_none)) + GWI_B(gwi_func_end(gwi, shred_args, ae_flag_none)) gwi_func_ini(gwi, "string", "arg"); gwi_func_arg(gwi, "int", "n"); - GWI_BB(gwi_func_end(gwi, shred_arg, ae_flag_none)) + GWI_B(gwi_func_end(gwi, shred_arg, ae_flag_none)) gwi_func_ini(gwi, "string", "name"); - GWI_BB(gwi_func_end(gwi, shred_name, ae_flag_none)) + GWI_B(gwi_func_end(gwi, shred_name, ae_flag_none)) gwi_func_ini(gwi, "string", "path"); - GWI_BB(gwi_func_end(gwi, shred_path, ae_flag_none)) + GWI_B(gwi_func_end(gwi, shred_path, ae_flag_none)) gwi_func_ini(gwi, "string", "dir"); - GWI_BB(gwi_func_end(gwi, shred_dir, ae_flag_none)) + GWI_B(gwi_func_end(gwi, shred_dir, ae_flag_none)) gwi_func_ini(gwi, "string", "code_name"); - GWI_BB(gwi_func_end(gwi, shred_code_name, ae_flag_none)) + GWI_B(gwi_func_end(gwi, shred_code_name, ae_flag_none)) gwi_func_ini(gwi, "string", "code_path"); - GWI_BB(gwi_func_end(gwi, shred_code_path, ae_flag_none)) + GWI_B(gwi_func_end(gwi, shred_code_path, ae_flag_none)) gwi_func_ini(gwi, "string", "code_dir"); - GWI_BB(gwi_func_end(gwi, shred_code_dir, ae_flag_none)) + GWI_B(gwi_func_end(gwi, shred_code_dir, ae_flag_none)) gwi_func_ini(gwi, "void", "set_cancel"); - gwi_func_arg(gwi, "int", "n"); - GWI_BB(gwi_func_end(gwi, shred_cancel, ae_flag_none)) + gwi_func_arg(gwi, "bool", "n"); + GWI_B(gwi_func_end(gwi, shred_cancel, ae_flag_none)) gwi_func_ini(gwi, "void", "test_cancel"); - GWI_BB(gwi_func_end(gwi, shred_test_cancel, ae_flag_none)) + GWI_B(gwi_func_end(gwi, shred_test_cancel, ae_flag_none)) gwi_func_ini(gwi, "void", "lock"); - GWI_BB(gwi_func_end(gwi, shred_lock, ae_flag_none)) + GWI_B(gwi_func_end(gwi, shred_lock, ae_flag_none)) gwi_func_ini(gwi, "void", "unlock"); - GWI_BB(gwi_func_end(gwi, shred_unlock, ae_flag_none)) + GWI_B(gwi_func_end(gwi, shred_unlock, ae_flag_none)) gwi_func_ini(gwi, "float", "get_now"); - GWI_BB(gwi_func_end(gwi, shred_now, ae_flag_none)) + GWI_B(gwi_func_end(gwi, shred_now, ae_flag_none)) gwi_func_ini(gwi, "UGen", "get_blackhole"); - GWI_BB(gwi_func_end(gwi, shred_blackhole, ae_flag_none)) + GWI_B(gwi_func_end(gwi, shred_blackhole, ae_flag_none)) - GWI_BB(gwi_class_end(gwi)) + GWI_B(gwi_class_end(gwi)) SET_FLAG(t_shred, abstract | ae_flag_final); gwi->gwion->type[et_shred] = t_shred; @@ -424,16 +424,16 @@ GWION_IMPORT(shred) { gwi_item_ini(gwi, "Event", "ev"); GWI_BB((o_fork_ev = gwi_item_end(gwi, ae_flag_const, num, 0))) gwi_func_ini(gwi, "void", "join"); - GWI_BB(gwi_func_end(gwi, fork_join, ae_flag_none)) + GWI_B(gwi_func_end(gwi, fork_join, ae_flag_none)) gwi_func_ini(gwi, "void", "test_cancel"); - GWI_BB(gwi_func_end(gwi, fork_test_cancel, ae_flag_none)) - GWI_BB(gwi_class_end(gwi)) + GWI_B(gwi_func_end(gwi, fork_test_cancel, ae_flag_none)) + GWI_B(gwi_class_end(gwi)) SET_FLAG(t_fork, abstract | ae_flag_final); 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, num, 0)) - GWI_BB(gwi_class_end(gwi)) + GWI_B(gwi_class_end(gwi)) SET_FLAG(t_typed, abstract | ae_flag_final); return GW_OK; } diff --git a/src/lib/sift.c b/src/lib/sift.c index f59cb2bd..0ed55fa4 100644 --- a/src/lib/sift.c +++ b/src/lib/sift.c @@ -76,7 +76,7 @@ static OP_CHECK(opck_ctrl) { GWION_IMPORT(sift) { const Type sift = gwi_class_ini(gwi, "Sift", "Shred"); SET_FLAG(sift, abstract | ae_flag_final); - GWI_BB(gwi_class_end(gwi)); + GWI_B(gwi_class_end(gwi)); gwidoc(gwi, "This operator expands too\n" "#!- spork {{\n" @@ -85,20 +85,20 @@ GWION_IMPORT(sift) { "#!- samp => now;\n" "#!- }\n" "#!- }"); - GWI_BB(gwi_oper_ini(gwi, "UGen", "function", "Sift")); - GWI_BB(gwi_oper_add(gwi, opck_ctrl)); - GWI_BB(gwi_oper_end(gwi, "|>", NULL)); + GWI_B(gwi_oper_ini(gwi, "UGen", "function", "Sift")); + GWI_B(gwi_oper_add(gwi, opck_ctrl)); + GWI_B(gwi_oper_end(gwi, "|>", NULL)); - GWI_BB(gwi_oper_ini(gwi, "Sift", "function", "Sift")); - GWI_BB(gwi_oper_add(gwi, opck_sift)); - GWI_BB(gwi_oper_end(gwi, "|>", NULL)); + GWI_B(gwi_oper_ini(gwi, "Sift", "function", "Sift")); + GWI_B(gwi_oper_add(gwi, opck_sift)); + GWI_B(gwi_oper_end(gwi, "|>", NULL)); - GWI_BB(gwi_oper_ini(gwi, "UGen", "funptr", "Sift")); - GWI_BB(gwi_oper_add(gwi, opck_ctrl)); - GWI_BB(gwi_oper_end(gwi, "|>", NULL)); + GWI_B(gwi_oper_ini(gwi, "UGen", "funptr", "Sift")); + GWI_B(gwi_oper_add(gwi, opck_ctrl)); + GWI_B(gwi_oper_end(gwi, "|>", NULL)); - GWI_BB(gwi_oper_ini(gwi, "Sift", "funptr", "Sift")); - GWI_BB(gwi_oper_add(gwi, opck_sift)); - GWI_BB(gwi_oper_end(gwi, "|>", NULL)); + GWI_B(gwi_oper_ini(gwi, "Sift", "funptr", "Sift")); + GWI_B(gwi_oper_add(gwi, opck_sift)); + GWI_B(gwi_oper_end(gwi, "|>", NULL)); return GW_OK; } diff --git a/src/lib/string.c b/src/lib/string.c index e7548b45..07ec04e7 100644 --- a/src/lib/string.c +++ b/src/lib/string.c @@ -83,9 +83,9 @@ static GACK(gack_string) { INTERP_PRINTF("%s", obj ? STRING(obj) : "(null string)"); } -static inline m_bool bounds(const m_str str, const m_int i) { - CHECK_BB(i); - return (m_uint)i <= strlen(str) ? GW_OK : GW_ERROR; +static inline bool bounds(const m_str str, const m_int i) { + CHECK_B(i); + return (m_uint)i <= strlen(str); } static INSTR(StringSlice) { @@ -96,7 +96,7 @@ static INSTR(StringSlice) { const size_t strsz = strlen(str); m_int end = *(m_uint *)REG(SZ_INT); if (end < 0) end = strsz + end - 1; - if (bounds(str, start) < 0 || bounds(str, end) < 0) { + if (!bounds(str, start) || !bounds(str, end)) { handle(shred, "OutOfBoundsStringSlice"); return; } @@ -481,113 +481,113 @@ GWION_IMPORT(string) { t_string->nspc->offset += SZ_INT; gwi_func_ini(gwi, "int", "size"); - GWI_BB(gwi_func_end(gwi, string_len, ae_flag_none)) + GWI_B(gwi_func_end(gwi, string_len, ae_flag_none)) gwi_func_ini(gwi, "string", "upper"); - GWI_BB(gwi_func_end(gwi, string_upper, ae_flag_none)) + GWI_B(gwi_func_end(gwi, string_upper, ae_flag_none)) gwi_func_ini(gwi, "string", "lower"); - GWI_BB(gwi_func_end(gwi, string_lower, ae_flag_none)) + GWI_B(gwi_func_end(gwi, string_lower, ae_flag_none)) gwi_func_ini(gwi, "string", "ltrim"); - GWI_BB(gwi_func_end(gwi, string_ltrim, ae_flag_none)) + GWI_B(gwi_func_end(gwi, string_ltrim, ae_flag_none)) gwi_func_ini(gwi, "string", "rtrim"); - GWI_BB(gwi_func_end(gwi, string_rtrim, ae_flag_none)) + GWI_B(gwi_func_end(gwi, string_rtrim, ae_flag_none)) gwi_func_ini(gwi, "string", "trim"); - GWI_BB(gwi_func_end(gwi, string_trim, ae_flag_none)) + GWI_B(gwi_func_end(gwi, string_trim, ae_flag_none)) gwi_func_ini(gwi, "string", "insert"); gwi_func_arg(gwi, "int", "pos"); gwi_func_arg(gwi, "string", "str"); - GWI_BB(gwi_func_end(gwi, string_insert, ae_flag_none)) + GWI_B(gwi_func_end(gwi, string_insert, ae_flag_none)) gwi_func_ini(gwi, "string", "replace"); gwi_func_arg(gwi, "int", "pos"); gwi_func_arg(gwi, "string", "str"); - GWI_BB(gwi_func_end(gwi, string_replace, ae_flag_none)) + GWI_B(gwi_func_end(gwi, string_replace, ae_flag_none)) gwi_func_ini(gwi, "string", "replace"); gwi_func_arg(gwi, "int", "pos"); gwi_func_arg(gwi, "int", "n"); gwi_func_arg(gwi, "string", "str"); - GWI_BB(gwi_func_end(gwi, string_replaceN, ae_flag_none)) + GWI_B(gwi_func_end(gwi, string_replaceN, ae_flag_none)) gwi_func_ini(gwi, "int", "find"); gwi_func_arg(gwi, "char", "c"); - GWI_BB(gwi_func_end(gwi, string_find, ae_flag_none)) + GWI_B(gwi_func_end(gwi, string_find, ae_flag_none)) gwi_func_ini(gwi, "int", "find"); gwi_func_arg(gwi, "char", "c"); gwi_func_arg(gwi, "int", "pos"); - GWI_BB(gwi_func_end(gwi, string_findStart, ae_flag_none)) + GWI_B(gwi_func_end(gwi, string_findStart, ae_flag_none)) gwi_func_ini(gwi, "int", "find"); gwi_func_arg(gwi, "string", "str"); - GWI_BB(gwi_func_end(gwi, string_findStr, ae_flag_none)) + GWI_B(gwi_func_end(gwi, string_findStr, ae_flag_none)) gwi_func_ini(gwi, "int", "find"); gwi_func_arg(gwi, "string", "str"); gwi_func_arg(gwi, "int", "pos"); - GWI_BB(gwi_func_end(gwi, string_findStrStart, ae_flag_none)) + GWI_B(gwi_func_end(gwi, string_findStrStart, ae_flag_none)) gwi_func_ini(gwi, "int", "rfind"); gwi_func_arg(gwi, "char", "c"); - GWI_BB(gwi_func_end(gwi, string_rfind, ae_flag_none)) + GWI_B(gwi_func_end(gwi, string_rfind, ae_flag_none)) gwi_func_ini(gwi, "int", "rfind"); gwi_func_arg(gwi, "char", "c"); gwi_func_arg(gwi, "int", "pos"); - GWI_BB(gwi_func_end(gwi, string_rfindStart, ae_flag_none)) + GWI_B(gwi_func_end(gwi, string_rfindStart, ae_flag_none)) gwi_func_ini(gwi, "int", "rfind"); gwi_func_arg(gwi, "string", "str"); - GWI_BB(gwi_func_end(gwi, string_rfindStr, ae_flag_none)) + GWI_B(gwi_func_end(gwi, string_rfindStr, ae_flag_none)) gwi_func_ini(gwi, "int", "rfind"); gwi_func_arg(gwi, "string", "str"); gwi_func_arg(gwi, "int", "pos"); - GWI_BB(gwi_func_end(gwi, string_rfindStrStart, ae_flag_none)) + GWI_B(gwi_func_end(gwi, string_rfindStrStart, ae_flag_none)) gwi_func_ini(gwi, "void", "erase"); gwi_func_arg(gwi, "int", "start"); gwi_func_arg(gwi, "int", "length"); - GWI_BB(gwi_func_end(gwi, string_erase, ae_flag_none)) + GWI_B(gwi_func_end(gwi, string_erase, ae_flag_none)) gwi_func_ini(gwi, "void", "save"); gwi_func_arg(gwi, "string", "path"); - GWI_BB(gwi_func_end(gwi, string_save, ae_flag_none)) + GWI_B(gwi_func_end(gwi, string_save, ae_flag_none)) gwi_func_ini(gwi, "string", "load"); gwi_func_arg(gwi, "string", "path"); - GWI_BB(gwi_func_end(gwi, string_load, ae_flag_static)) + GWI_B(gwi_func_end(gwi, string_load, ae_flag_static)) gwi_func_ini(gwi, "int", "atoi"); - GWI_BB(gwi_func_end(gwi, string_atoi, ae_flag_none)) + GWI_B(gwi_func_end(gwi, string_atoi, ae_flag_none)) gwi_func_ini(gwi, "int", "atoi2"); gwi_func_arg(gwi, "&int", "offset"); - GWI_BB(gwi_func_end(gwi, string_atoi2, ae_flag_none)) + GWI_B(gwi_func_end(gwi, string_atoi2, ae_flag_none)) gwi_func_ini(gwi, "float", "atof"); - GWI_BB(gwi_func_end(gwi, string_atof, ae_flag_none)) + GWI_B(gwi_func_end(gwi, string_atof, ae_flag_none)) - GWI_BB(gwi_class_end(gwi)) + GWI_B(gwi_class_end(gwi)) - GWI_BB(gwi_oper_ini(gwi, "int", "string", NULL)) - GWI_BB(gwi_oper_add(gwi, opck_string_access)) - GWI_BB(gwi_oper_emi(gwi, opem_string_access)) - GWI_BB(gwi_oper_end(gwi, "[]", NULL)) + GWI_B(gwi_oper_ini(gwi, "int", "string", NULL)) + GWI_B(gwi_oper_add(gwi, opck_string_access)) + GWI_B(gwi_oper_emi(gwi, opem_string_access)) + GWI_B(gwi_oper_end(gwi, "[]", NULL)) - GWI_BB(gwi_oper_ini(gwi, "string", "string", "bool")) - GWI_BB(gwi_oper_add(gwi, opck_string_eq)) - GWI_BB(gwi_oper_end(gwi, "==", String_eq)) - GWI_BB(gwi_oper_add(gwi, opck_string_neq)) - GWI_BB(gwi_oper_end(gwi, "!=", String_neq)) + GWI_B(gwi_oper_ini(gwi, "string", "string", "bool")) + GWI_B(gwi_oper_add(gwi, opck_string_eq)) + GWI_B(gwi_oper_end(gwi, "==", String_eq)) + GWI_B(gwi_oper_add(gwi, opck_string_neq)) + GWI_B(gwi_oper_end(gwi, "!=", String_neq)) - GWI_BB(gwi_oper_ini(gwi, "int", "string", "string")) - GWI_BB(gwi_oper_end(gwi, "[:]", StringSlice)) + GWI_B(gwi_oper_ini(gwi, "int", "string", "string")) + GWI_B(gwi_oper_end(gwi, "[:]", StringSlice)) struct SpecialId_ file_spid = { .ck = check_filepp, .is_const = 1}; diff --git a/src/lib/tmpl_info.c b/src/lib/tmpl_info.c index 067b75b0..414adc65 100644 --- a/src/lib/tmpl_info.c +++ b/src/lib/tmpl_info.c @@ -41,8 +41,8 @@ ANN static inline size_t tmpl_set(struct tmpl_info *info, const m_str str) { return len; } -ANN static ssize_t template_size(const Env env, struct tmpl_info *info) { - DECL_OB(const m_str, str, +ANN static size_t template_size(const Env env, struct tmpl_info *info) { + DECL_B(const m_str, str, = tl2str(env->gwion, info->td->types, info->td->tag.loc)); const size_t tmpl_sz = tmpl_set(info, str); const m_str base = !is_func(env->gwion, info->base) @@ -63,7 +63,7 @@ ANEW ANN static Symbol template_id(const Env env, vector_init(&info->type); vector_init(&info->size); ssize_t sz = template_size(env, info); - const Symbol sym = sz > GW_ERROR ? _template_id(env, info, sz) : NULL; + const Symbol sym = sz ? _template_id(env, info, sz) : NULL; for (m_uint i = 0; i < vector_size(&info->type); ++i) mp_free2(env->gwion->mp, vector_at(&info->size, i), (m_str)vector_at(&info->type, i)); @@ -72,14 +72,7 @@ ANEW ANN static Symbol template_id(const Env env, return sym; } -ANN static m_bool template_match(Specialized_List sl, TmplArg_List tl) { -// uint32_t i = 0; -// while ((call = call->next)) i++; -//&& (base = base->next)) -// while ((call = call->next) && (base = base->next)) -// ; -// return i = base->len ? GW_OK : GW_ERROR; -// return !call ? GW_OK : GW_ERROR; +ANN static bool template_match(Specialized_List sl, TmplArg_List tl) { return tl->len >= sl->len; } @@ -90,7 +83,7 @@ ANN static Type _tmpl_exists(const Env env, const Symbol name) { } ANN Type tmpl_exists(const Env env, struct tmpl_info *const info) { - if (template_match(info->list, info->td->types) < 0) // invalid template + if (!template_match(info->list, info->td->types)) // invalid template ERR_N(info->td->tag.loc, _("invalid template types number")); if (!info->name) info->name = template_id(env, info); diff --git a/src/lib/ugen.c b/src/lib/ugen.c index 7162f8af..b037e8de 100644 --- a/src/lib/ugen.c +++ b/src/lib/ugen.c @@ -407,40 +407,40 @@ GWION_IMPORT(ugen) { gwi->gwion->type[et_ugen] = t_ugen; // use func t_ugen->nspc->offset += SZ_INT; - GWI_BB(gwi_func_ini(gwi, "UGen", "chan")) - GWI_BB(gwi_func_arg(gwi, "int", "arg0")) - GWI_BB(gwi_func_end(gwi, ugen_channel, ae_flag_none)) + GWI_B(gwi_func_ini(gwi, "UGen", "chan")) + GWI_B(gwi_func_arg(gwi, "int", "arg0")) + GWI_B(gwi_func_end(gwi, ugen_channel, ae_flag_none)) - GWI_BB(gwi_func_ini(gwi, "int", "op")) - GWI_BB(gwi_func_end(gwi, ugen_get_op, ae_flag_none)) + GWI_B(gwi_func_ini(gwi, "int", "op")) + GWI_B(gwi_func_end(gwi, ugen_get_op, ae_flag_none)) - GWI_BB(gwi_func_ini(gwi, "int", "op")) - GWI_BB(gwi_func_arg(gwi, "int", "arg0")) - GWI_BB(gwi_func_end(gwi, ugen_set_op, ae_flag_none)) + GWI_B(gwi_func_ini(gwi, "int", "op")) + GWI_B(gwi_func_arg(gwi, "int", "arg0")) + GWI_B(gwi_func_end(gwi, ugen_set_op, ae_flag_none)) - GWI_BB(gwi_func_ini(gwi, "float", "last")) - GWI_BB(gwi_func_end(gwi, ugen_get_last, ae_flag_none)) - GWI_BB(gwi_class_end(gwi)) + GWI_B(gwi_func_ini(gwi, "float", "last")) + GWI_B(gwi_func_end(gwi, ugen_get_last, ae_flag_none)) + GWI_B(gwi_class_end(gwi)) - GWI_BB(gwi_oper_ini(gwi, "UGen", "UGen", "UGen")) + GWI_B(gwi_oper_ini(gwi, "UGen", "UGen", "UGen")) _CHECK_OP("~>", chuck_ugen, UgenConnect) _CHECK_OP("~<", chuck_ugen, UgenDisconnect) _CHECK_OP(":~>", chuck_ugen, TrigConnect) _CHECK_OP(":~<", chuck_ugen, TrigDisconnect) - GWI_BB(gwi_oper_ini(gwi, "UGen[]", "UGen[]", "UGen[]")) + GWI_B(gwi_oper_ini(gwi, "UGen[]", "UGen[]", "UGen[]")) _CHECK_OP("~>", chuck_ugen, UgenAAConnect) _CHECK_OP("~<", chuck_ugen, UgenAADisconnect) _CHECK_OP(":~>", chuck_ugen, TrigAAConnect) _CHECK_OP(":~<", chuck_ugen, TrigAADisconnect) - GWI_BB(gwi_oper_ini(gwi, "UGen", "UGen[]", "UGen[]")) + GWI_B(gwi_oper_ini(gwi, "UGen", "UGen[]", "UGen[]")) _CHECK_OP("~>", chuck_ugen, UgenUAConnect) _CHECK_OP("~<", chuck_ugen, UgenUADisconnect) _CHECK_OP(":~>", chuck_ugen, TrigUAConnect) _CHECK_OP(":~<", chuck_ugen, TrigUADisconnect) - GWI_BB(gwi_oper_ini(gwi, "UGen[]", "UGen", "UGen")) + GWI_B(gwi_oper_ini(gwi, "UGen[]", "UGen", "UGen")) _CHECK_OP("~>", chuck_ugen, UgenAUConnect) _CHECK_OP("~<", chuck_ugen, UgenAUDisconnect) _CHECK_OP(":~>", chuck_ugen, TrigAUConnect) diff --git a/src/lib/union.c b/src/lib/union.c index 6ad35d7e..d9c6a32a 100644 --- a/src/lib/union.c +++ b/src/lib/union.c @@ -165,10 +165,10 @@ ANN GWION_IMPORT(union) { .type = gwi->gwion->type[et_none], .exec = NoOp, .is_const = 1}; gwi_specialid(gwi, "None", &spid); - GWI_BB(gwi_oper_ini(gwi, "None", "None", "None")) - GWI_BB(gwi_oper_add(gwi, opck_none)) - GWI_BB(gwi_oper_emi(gwi, opem_none)) - GWI_BB(gwi_oper_end(gwi, ":=>", NoOp)) + GWI_B(gwi_oper_ini(gwi, "None", "None", "None")) + GWI_B(gwi_oper_add(gwi, opck_none)) + GWI_B(gwi_oper_emi(gwi, opem_none)) + GWI_B(gwi_oper_end(gwi, ":=>", NoOp)) const Type t_union = gwi_struct_ini(gwi, "union"); //gwi_class_xtor(gwi, NULL, UnionDtor); @@ -177,19 +177,19 @@ ANN GWION_IMPORT(union) { GWI_BB(gwi_item_ini(gwi, "int", "index")) GWI_BB(gwi_item_end(gwi, ae_flag_const, num, 0)) /* - GWI_BB(gwi_func_ini(gwi, "void", "@ctor")) - GWI_BB(gwi_func_end(gwi, union_ctor, ae_flag_none)) + GWI_B(gwi_func_ini(gwi, "void", "@ctor")) + GWI_B(gwi_func_end(gwi, union_ctor, ae_flag_none)) */ - GWI_BB(gwi_func_ini(gwi, "bool", "is")) - GWI_BB(gwi_func_arg(gwi, "int", "member")) - GWI_BB(gwi_func_end(gwi, union_is, ae_flag_none)) - GWI_BB(gwi_func_ini(gwi, "auto", "new:[T]")) - GWI_BB(gwi_func_arg(gwi, "int", "size")) - GWI_BB(gwi_func_arg(gwi, "int", "id")) - GWI_BB(gwi_func_arg(gwi, "T", "value")) - GWI_BB(gwi_func_end(gwi, union_new, ae_flag_none)) + GWI_B(gwi_func_ini(gwi, "bool", "is")) + GWI_B(gwi_func_arg(gwi, "int", "member")) + GWI_B(gwi_func_end(gwi, union_is, ae_flag_none)) + GWI_B(gwi_func_ini(gwi, "auto", "new:[T]")) + GWI_B(gwi_func_arg(gwi, "int", "size")) + GWI_B(gwi_func_arg(gwi, "int", "id")) + GWI_B(gwi_func_arg(gwi, "T", "value")) + GWI_B(gwi_func_end(gwi, union_new, ae_flag_none)) - GWI_BB(gwi_class_end(gwi)) + GWI_B(gwi_class_end(gwi)) const struct Op_Func opfunc0 = {.ck = opck_union_is}; CHECK_B(add_op_func_check(gwi->gwion->env, t_union, &opfunc0, 0)); @@ -197,14 +197,14 @@ ANN GWION_IMPORT(union) { const struct Op_Func opfunc1 = {.ck = opck_union_new}; CHECK_B(add_op_func_check(gwi->gwion->env, t_union, &opfunc1, 1)); - GWI_BB(gwi_oper_ini(gwi, "union", (m_str)OP_ANY_TYPE, NULL)) - GWI_BB(gwi_oper_emi(gwi, opem_union_dot)) - GWI_BB(gwi_oper_end(gwi, ".", NULL)) + GWI_B(gwi_oper_ini(gwi, "union", (m_str)OP_ANY_TYPE, NULL)) + GWI_B(gwi_oper_emi(gwi, opem_union_dot)) + GWI_B(gwi_oper_end(gwi, ".", NULL)) - GWI_BB(gwi_union_ini(gwi, "Option:[A]")) - GWI_BB(gwi_union_add(gwi, "None", "none")) - GWI_BB(gwi_union_add(gwi, "A", "val")) - GWI_BB(gwi_union_end(gwi, ae_flag_none)) + GWI_B(gwi_union_ini(gwi, "Option:[A]")) + GWI_B(gwi_union_add(gwi, "None", "none")) + GWI_B(gwi_union_add(gwi, "A", "val")) + GWI_B(gwi_union_end(gwi, ae_flag_none)) return GW_OK; } diff --git a/src/lib/xork.c b/src/lib/xork.c index 5eaeb39a..73bd5144 100644 --- a/src/lib/xork.c +++ b/src/lib/xork.c @@ -91,13 +91,13 @@ static FREEARG(clean_fast_except) { } GWION_IMPORT(xork) { - GWI_BB(gwi_oper_ini(gwi, NULL, (m_str)OP_ANY_TYPE, NULL)) - GWI_BB(gwi_oper_add(gwi, opck_spork)) - GWI_BB(gwi_oper_emi(gwi, opem_spork)) - GWI_BB(gwi_oper_end(gwi, "spork", NULL)) - GWI_BB(gwi_oper_add(gwi, opck_spork)) - GWI_BB(gwi_oper_emi(gwi, opem_spork)) - GWI_BB(gwi_oper_end(gwi, "fork", NULL)) + GWI_B(gwi_oper_ini(gwi, NULL, (m_str)OP_ANY_TYPE, NULL)) + GWI_B(gwi_oper_add(gwi, opck_spork)) + GWI_B(gwi_oper_emi(gwi, opem_spork)) + GWI_B(gwi_oper_end(gwi, "spork", NULL)) + GWI_B(gwi_oper_add(gwi, opck_spork)) + GWI_B(gwi_oper_emi(gwi, opem_spork)) + GWI_B(gwi_oper_end(gwi, "fork", NULL)) gwi_register_freearg(gwi, SporkIni, freearg_xork); gwi_register_freearg(gwi, fast_except, clean_fast_except); return GW_OK; diff --git a/src/parse/check.c b/src/parse/check.c index e729c7bf..6c8a296d 100644 --- a/src/parse/check.c +++ b/src/parse/check.c @@ -1742,8 +1742,8 @@ ANN static bool check_stmt_defer(const Env env, const Stmt_Defer stmt) { return check_stmt(env, stmt->stmt); } -#define check_stmt_retry bdummy_func -#define check_stmt_spread bdummy_func +#define check_stmt_retry dummy_func +#define check_stmt_spread dummy_func DECL_STMT_FUNC(check, bool, Env) ANN bool check_stmt(const Env env, Stmt* stmt) { @@ -2089,7 +2089,7 @@ ANN bool check_fptr_def(const Env env, const Fptr_Def fptr) { return ret; } -#define check_prim_def bdummy_func +#define check_prim_def dummy_func HANDLE_SECTION_FUNC(check, bool, Env) ANN static bool check_parent(const Env env, const Class_Def cdef) { diff --git a/src/parse/scan1.c b/src/parse/scan1.c index 39314f57..a32f1ebd 100644 --- a/src/parse/scan1.c +++ b/src/parse/scan1.c @@ -256,9 +256,9 @@ ANN static inline bool scan1_exp_unary(const restrict Env env, return true; } -#define scan1_exp_lambda bdummy_func -#define scan1_exp_td bdummy_func -HANDLE_EXP_FUNC_B(scan1, bool, Env) +#define scan1_exp_lambda dummy_func +#define scan1_exp_td dummy_func +HANDLE_EXP_FUNC(scan1, bool, Env) ANN static inline bool _scan1_stmt_match_case(const restrict Env env, const Stmt_Match stmt) { @@ -590,9 +590,9 @@ ANN bool scan1_union_def(const Env env, const Union_Def udef) { #define scan1_stmt_while scan1_stmt_flow #define scan1_stmt_until scan1_stmt_flow -#define scan1_stmt_continue bdummy_func -#define scan1_stmt_break bdummy_func -#define scan1_stmt_retry bdummy_func +#define scan1_stmt_continue dummy_func +#define scan1_stmt_break dummy_func +#define scan1_stmt_retry dummy_func ANN static bool scan1_stmt_return(const Env env, const Stmt_Exp stmt) { if (!env->func) @@ -791,9 +791,9 @@ ANN bool scan1_func_def(const Env env, const Func_Def fdef) { return ret; } -#define scan1_trait_def bdummy_func -#define scan1_extend_def bdummy_func -#define scan1_prim_def bdummy_func +#define scan1_trait_def dummy_func +#define scan1_extend_def dummy_func +#define scan1_prim_def dummy_func HANDLE_SECTION_FUNC(scan1, bool, Env) ANN static Type scan1_get_parent(const Env env, const Type_Def tdef) { diff --git a/src/parse/scan2.c b/src/parse/scan2.c index 97a5bbb6..d9d066c9 100644 --- a/src/parse/scan2.c +++ b/src/parse/scan2.c @@ -219,9 +219,9 @@ ANN static inline bool scan2_stmt_match(const restrict Env env, RET_NSPC(_scan2_stmt_match(env, stmt)) } -#define scan2_exp_lambda bdummy_func -#define scan2_exp_td bdummy_func -HANDLE_EXP_FUNC_B(scan2, bool, Env) +#define scan2_exp_lambda dummy_func +#define scan2_exp_td dummy_func +HANDLE_EXP_FUNC(scan2, bool, Env) #define scan2_stmt_func(name, type, prolog, exp) \ describe_stmt_func(scan2, name, type, prolog, exp) @@ -256,10 +256,10 @@ ANN bool scan2_union_def(const Env env NUSED, const Union_Def udef) { #define scan2_stmt_while scan2_stmt_flow #define scan2_stmt_until scan2_stmt_flow -#define scan2_stmt_continue bdummy_func -#define scan2_stmt_break bdummy_func +#define scan2_stmt_continue dummy_func +#define scan2_stmt_break dummy_func #define scan2_stmt_return scan2_stmt_exp -#define scan2_stmt_retry bdummy_func +#define scan2_stmt_retry dummy_func ANN static bool scan2_stmt_pp(const Env env, const Stmt_PP stmt) { if (stmt->pp_type == ae_pp_include) env->name = stmt->data; @@ -270,7 +270,7 @@ ANN static bool scan2_stmt_defer(const Env env, const Stmt_Defer stmt) { return scan2_stmt(env, stmt->stmt); } -#define scan2_stmt_spread bdummy_func +#define scan2_stmt_spread dummy_func DECL_STMT_FUNC(scan2, bool, Env) @@ -563,10 +563,10 @@ ANN bool scan2_func_def(const Env env, const Func_Def fdef) { return ret; } -#define scan2_enum_def bdummy_func -#define scan2_trait_def bdummy_func -#define scan2_extend_def bdummy_func -#define scan2_prim_def bdummy_func +#define scan2_enum_def dummy_func +#define scan2_trait_def dummy_func +#define scan2_extend_def dummy_func +#define scan2_prim_def dummy_func HANDLE_SECTION_FUNC(scan2, bool, Env) ANN static bool scan2_parent(const Env env, const Class_Def cdef) { diff --git a/src/pass.c b/src/pass.c index 4a785377..529692cc 100644 --- a/src/pass.c +++ b/src/pass.c @@ -20,7 +20,7 @@ static bool typecheck_ast(const Env env, Ast *ast) { env->context->error = true; if(!check_ast(env, ast)) env->context->error = true; -// CHECK_b(traverse_ast(env, ast)); +// CHECK_B(traverse_ast(env, ast)); // if(env->scope->poison)env->context->error = true; if(env->context->error)return false; return true; diff --git a/tests/plug/array.c b/tests/plug/array.c index 54a71d50..6988b4c1 100644 --- a/tests/plug/array.c +++ b/tests/plug/array.c @@ -15,10 +15,10 @@ GWION_IMPORT(array) { GWI_OB(gwi_class_ini(gwi, "ArrayTest", NULL)) GWI_BB(gwi_item_ini(gwi, "int[]", "int_array")) GWI_BB(gwi_item_end(gwi, 0, obj, NULL)) // import array var - GWI_BB(gwi_func_ini(gwi, "float[][]", "f")) - GWI_BB(gwi_func_end(gwi, test_mfun, ae_flag_none)) - GWI_BB(gwi_func_ini(gwi, "float[][]", "g")) - GWI_BB(gwi_func_end(gwi, test_mfun, ae_flag_none)) - GWI_BB(gwi_class_end(gwi)) + GWI_B(gwi_func_ini(gwi, "float[][]", "f")) + GWI_B(gwi_func_end(gwi, test_mfun, ae_flag_none)) + GWI_B(gwi_func_ini(gwi, "float[][]", "g")) + GWI_B(gwi_func_end(gwi, test_mfun, ae_flag_none)) + GWI_B(gwi_class_end(gwi)) return GW_OK; } diff --git a/tests/plug/array_in_var_name_fail.c b/tests/plug/array_in_var_name_fail.c index ab791ebe..e728a77b 100644 --- a/tests/plug/array_in_var_name_fail.c +++ b/tests/plug/array_in_var_name_fail.c @@ -10,7 +10,7 @@ #include "gwi.h" GWION_IMPORT(array_in_var_name_fail) { - GWI_BB(gwi_union_ini(gwi, "U")) - GWI_BB(gwi_union_add(gwi, "int", "i")) + GWI_B(gwi_union_ini(gwi, "U")) + GWI_B(gwi_union_add(gwi, "int", "i")) return GW_OK; } diff --git a/tests/plug/callback.c b/tests/plug/callback.c index db4bbdd7..4109bcef 100644 --- a/tests/plug/callback.c +++ b/tests/plug/callback.c @@ -65,13 +65,13 @@ static SFUN(cb_func) { } GWION_IMPORT(callback) { - GWI_BB(gwi_fptr_ini(gwi, "Vec4", "PtrType")) + GWI_B(gwi_fptr_ini(gwi, "Vec4", "PtrType")) GWI_OB(gwi_fptr_end(gwi, 0)) GWI_OB(gwi_class_ini(gwi, "Callback", NULL)) - GWI_BB(gwi_func_ini(gwi, "int", "callback")) - GWI_BB(gwi_func_arg(gwi, "PtrType", "func")) - GWI_BB(gwi_func_end(gwi, cb_func, ae_flag_static)) - GWI_BB(gwi_class_end(gwi)) + GWI_B(gwi_func_ini(gwi, "int", "callback")) + GWI_B(gwi_func_arg(gwi, "PtrType", "func")) + GWI_B(gwi_func_end(gwi, cb_func, ae_flag_static)) + GWI_B(gwi_class_end(gwi)) return GW_OK; } diff --git a/tests/plug/class_template.c b/tests/plug/class_template.c index 2a05bf3c..3b586118 100644 --- a/tests/plug/class_template.c +++ b/tests/plug/class_template.c @@ -33,10 +33,10 @@ GWION_IMPORT(class_template) { GWI_BB((o_map_key = gwi_item_end(gwi, ae_flag_none, obj, NULL))) GWI_BB(gwi_item_ini(gwi, "B[]", "value")) GWI_BB((o_map_value = gwi_item_end(gwi, ae_flag_none, obj, NULL))) - GWI_BB(gwi_func_ini(gwi, "int", ":[C,D]test")) - GWI_BB(gwi_func_end(gwi, (f_xfun)1, ae_flag_none)) + GWI_B(gwi_func_ini(gwi, "int", ":[C,D]test")) + GWI_B(gwi_func_end(gwi, (f_xfun)1, ae_flag_none)) - GWI_BB(gwi_class_end(gwi)) + GWI_B(gwi_class_end(gwi)) GWI_BB(gwi_item_ini(gwi, ":[:[int]Ptr,int[]]ClassTemplate", "testObject")) GWI_BB(gwi_item_end(gwi, ae_flag_none, obj, NULL)) return GW_OK; diff --git a/tests/plug/class_template_fail.c b/tests/plug/class_template_fail.c index 99941a83..06ad7e54 100644 --- a/tests/plug/class_template_fail.c +++ b/tests/plug/class_template_fail.c @@ -11,8 +11,8 @@ GWION_IMPORT(class_template_fail) { GWI_OB(gwi_class_ini(gwi, ":[A,B]ClassTemplate", NULL)) - GWI_BB(gwi_func_ini(gwi, "int", "test")) - GWI_BB(gwi_func_end(gwi, (f_xfun)1, ae_flag_none)) - GWI_BB(gwi_class_end(gwi)) + GWI_B(gwi_func_ini(gwi, "int", "test")) + GWI_B(gwi_func_end(gwi, (f_xfun)1, ae_flag_none)) + GWI_B(gwi_class_end(gwi)) return GW_OK; } diff --git a/tests/plug/class_template_invalid.c b/tests/plug/class_template_invalid.c index 4bd0dd2f..92ed1b6c 100644 --- a/tests/plug/class_template_invalid.c +++ b/tests/plug/class_template_invalid.c @@ -20,10 +20,10 @@ GWION_IMPORT(class_template_invalid) { GWI_BB((o_map_key = gwi_item_end(gwi, ae_flag_none, obj, NULL))) GWI_BB(gwi_item_ini(gwi, "B[]", "value")) GWI_BB((o_map_value = gwi_item_end(gwi, ae_flag_none, obj, NULL))) - GWI_BB(gwi_func_ini(gwi, "int", "test:[C,D]")) - GWI_BB(gwi_func_end(gwi, (f_xfun)1, ae_flag_none)) + GWI_B(gwi_func_ini(gwi, "int", "test:[C,D]")) + GWI_B(gwi_func_end(gwi, (f_xfun)1, ae_flag_none)) - GWI_BB(gwi_class_end(gwi)) + GWI_B(gwi_class_end(gwi)) GWI_BB(gwi_item_ini(gwi, "ClassTemplate:[:[int]Ptr,int[]]", "testObject")) GWI_BB(gwi_item_end(gwi, ae_flag_none, obj, NULL)) return GW_OK; diff --git a/tests/plug/compile_file.c b/tests/plug/compile_file.c index 563affaa..ddd76fed 100644 --- a/tests/plug/compile_file.c +++ b/tests/plug/compile_file.c @@ -15,10 +15,9 @@ GWION_IMPORT(compile_file) { DECL_OB(FILE *, file, = fopen("rm_me.gw", "w+")); if(fprintf(file, "1;") >= 0) { rewind(file); - const m_bool ret = - compile_file(gwi->gwion, __FILE__, file) ? GW_OK : GW_ERROR; + const bool ret = compile_file(gwi->gwion, __FILE__, file); fclose(file); return ret; } - return GW_ERROR; + return false; } diff --git a/tests/plug/compile_string.c b/tests/plug/compile_string.c index 899381db..5e5d2c77 100644 --- a/tests/plug/compile_string.c +++ b/tests/plug/compile_string.c @@ -12,5 +12,5 @@ #include GWION_IMPORT(compile_string) { - return compile_string(gwi->gwion, __FILE__, "1;") ? GW_OK : GW_ERROR; + return compile_string(gwi->gwion, __FILE__, "1;"); } diff --git a/tests/plug/coverage.c b/tests/plug/coverage.c index 2340da09..dc7da459 100644 --- a/tests/plug/coverage.c +++ b/tests/plug/coverage.c @@ -14,10 +14,10 @@ SFUN(coverage_float) { *(m_float *)RETURN = 0; } GWION_IMPORT(coverage) { GWI_OB(gwi_class_ini(gwi, "Coverage", NULL)) - GWI_BB(gwi_func_ini(gwi, "int", "i")) - GWI_BB(gwi_func_end(gwi, coverage_int, ae_flag_static)) - GWI_BB(gwi_func_ini(gwi, "float", "f")) - GWI_BB(gwi_func_end(gwi, coverage_float, ae_flag_static)) + GWI_B(gwi_func_ini(gwi, "int", "i")) + GWI_B(gwi_func_end(gwi, coverage_int, ae_flag_static)) + GWI_B(gwi_func_ini(gwi, "float", "f")) + GWI_B(gwi_func_end(gwi, coverage_float, ae_flag_static)) GWI_BB(gwi_item_ini(gwi, "int", "s_i")) GWI_BB(gwi_item_end(gwi, ae_flag_static, num, 5)) @@ -34,6 +34,6 @@ GWION_IMPORT(coverage) { GWI_BB(gwi_item_ini(gwi, "int[][]", "test_array")) GWI_BB(gwi_item_end(gwi, ae_flag_none, obj, NULL)) - GWI_BB(gwi_class_end(gwi)) + GWI_B(gwi_class_end(gwi)) return GW_OK; } diff --git a/tests/plug/empty_union.c b/tests/plug/empty_union.c index ca107e84..90b5986f 100644 --- a/tests/plug/empty_union.c +++ b/tests/plug/empty_union.c @@ -9,7 +9,7 @@ #include "import.h" GWION_IMPORT(empty_union) { - GWI_BB(gwi_union_ini(gwi, "U")) - GWI_OB(gwi_union_end(gwi, 0)) + GWI_B(gwi_union_ini(gwi, "U")) + GWI_B(gwi_union_end(gwi, 0)) return GW_OK; } diff --git a/tests/plug/end_class.c b/tests/plug/end_class.c index 08b1d655..8a2c7893 100644 --- a/tests/plug/end_class.c +++ b/tests/plug/end_class.c @@ -10,6 +10,6 @@ MFUN(test_mfun) {} GWION_IMPORT(end_class) { - GWI_BB(gwi_class_end(gwi)) + GWI_B(gwi_class_end(gwi)) return GW_OK; } diff --git a/tests/plug/enum.c b/tests/plug/enum.c index a9b35cec..4cafdecd 100644 --- a/tests/plug/enum.c +++ b/tests/plug/enum.c @@ -9,17 +9,17 @@ #include "import.h" GWION_IMPORT(enum) { - 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_B(gwi_enum_ini(gwi, "test")) + GWI_B(gwi_enum_add(gwi, "TYPED_ENUM0", 0)) + GWI_B(gwi_enum_add(gwi, "TYPED_ENUM1", 1)) + GWI_B(gwi_enum_add(gwi, "TYPED_ENUM2", 2)) + GWI_B(gwi_enum_add(gwi, "TYPED_ENUM3", 3)) + GWI_B(gwi_enum_add(gwi, "TYPED_ENUM4", 4)) + GWI_B(gwi_enum_add(gwi, "TYPED_ENUM5", 5)) + GWI_B(gwi_enum_add(gwi, "TYPED_ENUM6", 6)) + GWI_B(gwi_enum_add(gwi, "TYPED_ENUM7", 7)) + GWI_B(gwi_enum_add(gwi, "TYPED_ENUM8", 8)) + GWI_B(gwi_enum_add(gwi, "TYPED_ENUM9", 9)) GWI_OB(gwi_enum_end(gwi)) GWI_OB(gwi_class_end(gwi)) diff --git a/tests/plug/enum_fail.c b/tests/plug/enum_fail.c index c2cafd57..db1b67cb 100644 --- a/tests/plug/enum_fail.c +++ b/tests/plug/enum_fail.c @@ -9,8 +9,8 @@ #include "import.h" GWION_IMPORT(enum_fail) { - GWI_BB(gwi_enum_ini(gwi, "int")) - GWI_BB(gwi_enum_add(gwi, "zero", 0)) + GWI_B(gwi_enum_ini(gwi, "int")) + GWI_B(gwi_enum_add(gwi, "zero", 0)) GWI_OB(gwi_enum_end(gwi)) return GW_OK; } diff --git a/tests/plug/enum_fail2.c b/tests/plug/enum_fail2.c index 63f85fdd..ee0d9849 100644 --- a/tests/plug/enum_fail2.c +++ b/tests/plug/enum_fail2.c @@ -9,8 +9,8 @@ #include "import.h" GWION_IMPORT(enum_fail2) { - GWI_BB(gwi_enum_ini(gwi, "tmp")) - GWI_BB(gwi_enum_add(gwi, "adc", 0)) + GWI_B(gwi_enum_ini(gwi, "tmp")) + GWI_B(gwi_enum_add(gwi, "adc", 0)) GWI_OB(gwi_enum_end(gwi)) return GW_OK; } diff --git a/tests/plug/enum_fail3.c b/tests/plug/enum_fail3.c index a6c4f0c6..eed36eff 100644 --- a/tests/plug/enum_fail3.c +++ b/tests/plug/enum_fail3.c @@ -9,8 +9,8 @@ #include "import.h" GWION_IMPORT(enum_fail3) { - GWI_BB(gwi_enum_ini(gwi, "test")) - GWI_BB(gwi_enum_add(gwi, "adc", 0)) - GWI_BB(gwi_enum_ini(gwi, "error")) + GWI_B(gwi_enum_ini(gwi, "test")) + GWI_B(gwi_enum_add(gwi, "adc", 0)) + GWI_B(gwi_enum_ini(gwi, "error")) return GW_OK; } diff --git a/tests/plug/extend_array.c b/tests/plug/extend_array.c index 3633ba27..b7603875 100644 --- a/tests/plug/extend_array.c +++ b/tests/plug/extend_array.c @@ -12,6 +12,6 @@ GWION_IMPORT(extend_array) { GWI_OB(gwi_class_ini(gwi, "ArrayExt", "float[1]")) - GWI_BB(gwi_class_end(gwi)) + GWI_B(gwi_class_end(gwi)) return GW_OK; } diff --git a/tests/plug/fail_on_next_arg.c b/tests/plug/fail_on_next_arg.c index 5533acf0..830dfd2d 100644 --- a/tests/plug/fail_on_next_arg.c +++ b/tests/plug/fail_on_next_arg.c @@ -11,8 +11,8 @@ #include "gwi.h" GWION_IMPORT(fail_on_next_arg) { - GWI_BB(gwi_func_ini(gwi, "void", "test")) - GWI_BB(gwi_func_arg(gwi, "int", "i")) - GWI_BB(gwi_func_arg(gwi, "int", "j")) + GWI_B(gwi_func_ini(gwi, "void", "test")) + GWI_B(gwi_func_arg(gwi, "int", "i")) + GWI_B(gwi_func_arg(gwi, "int", "j")) return gwi_func_end(gwi, (f_xfun)1, ae_flag_none); } diff --git a/tests/plug/fail_on_next_arg2.c b/tests/plug/fail_on_next_arg2.c index 07b02e6c..526d4708 100644 --- a/tests/plug/fail_on_next_arg2.c +++ b/tests/plug/fail_on_next_arg2.c @@ -11,9 +11,9 @@ #include "gwi.h" GWION_IMPORT(fail_on_next_arg2) { - GWI_BB(gwi_func_ini(gwi, "void", "test")) - GWI_BB(gwi_func_arg(gwi, "int", "i")) - GWI_BB(gwi_func_arg(gwi, "i;t", "j")) - GWI_BB(gwi_func_arg(gwi, "int", "j[]")) + GWI_B(gwi_func_ini(gwi, "void", "test")) + GWI_B(gwi_func_arg(gwi, "int", "i")) + GWI_B(gwi_func_arg(gwi, "i;t", "j")) + GWI_B(gwi_func_arg(gwi, "int", "j[]")) return gwi_func_end(gwi, (f_xfun)1, ae_flag_none); } diff --git a/tests/plug/fptr.c b/tests/plug/fptr.c index 7a321531..aa99f196 100644 --- a/tests/plug/fptr.c +++ b/tests/plug/fptr.c @@ -10,16 +10,16 @@ static MFUN(test_func) { puts("test"); } GWION_IMPORT(fptr) { - GWI_BB(gwi_fptr_ini(gwi, "void", "PtrType")) + GWI_B(gwi_fptr_ini(gwi, "void", "PtrType")) GWI_OB(gwi_fptr_end(gwi, 0)) GWI_OB(gwi_class_ini(gwi, "FuncTypedef", NULL)) - GWI_BB(gwi_fptr_ini(gwi, "void", "PtrType")) + GWI_B(gwi_fptr_ini(gwi, "void", "PtrType")) GWI_OB(gwi_fptr_end(gwi, ae_flag_static)) - GWI_BB(gwi_func_ini(gwi, "void", "test_func")) - GWI_BB(gwi_func_end(gwi, test_func, ae_flag_static)) + GWI_B(gwi_func_ini(gwi, "void", "test_func")) + GWI_B(gwi_func_end(gwi, test_func, ae_flag_static)) GWI_BB(gwi_item_ini(gwi, "PtrType", "ptr")) GWI_BB(gwi_item_end(gwi, ae_flag_static, obj, NULL)) - GWI_BB(gwi_class_end(gwi)) + GWI_B(gwi_class_end(gwi)) return GW_OK; } diff --git a/tests/plug/fptr_tmpl.c b/tests/plug/fptr_tmpl.c index d46872ad..cd7bfce3 100644 --- a/tests/plug/fptr_tmpl.c +++ b/tests/plug/fptr_tmpl.c @@ -11,7 +11,7 @@ GWION_IMPORT(fptr_tmpl) { Type t_func_typedef; GWI_OB((t_func_typedef = gwi_mk_type(gwi, "FuncTypedef", SZ_INT, NULL))) - GWI_BB(gwi_fptr_ini(gwi, "int", "test:[test]")) + GWI_B(gwi_fptr_ini(gwi, "int", "test:[test]")) GWI_OB(gwi_fptr_end(gwi, 0)) return GW_OK; } diff --git a/tests/plug/fptr_tmpl_fail.c b/tests/plug/fptr_tmpl_fail.c index cee2c9d9..5fad173e 100644 --- a/tests/plug/fptr_tmpl_fail.c +++ b/tests/plug/fptr_tmpl_fail.c @@ -9,7 +9,7 @@ #include "import.h" GWION_IMPORT(fptr_tmpl_fail) { - GWI_BB(gwi_fptr_ini(gwi, "int~", "test:[A]")) + GWI_B(gwi_fptr_ini(gwi, "int~", "test:[A]")) GWI_OB(gwi_fptr_end(gwi, 0)) return GW_OK; } diff --git a/tests/plug/func_fail.c b/tests/plug/func_fail.c index 6a9850ed..20bf9599 100644 --- a/tests/plug/func_fail.c +++ b/tests/plug/func_fail.c @@ -10,9 +10,9 @@ #include "instr.h" GWION_IMPORT(func_fail) { - GWI_BB(gwi_func_ini(gwi, "int", "test")) - GWI_BB(gwi_func_arg(gwi, "int", "i[][]")) - GWI_BB(gwi_func_arg(gwi, "Int", "i")) - GWI_BB(gwi_func_end(gwi, (f_xfun)1, ae_flag_none)) + GWI_B(gwi_func_ini(gwi, "int", "test")) + GWI_B(gwi_func_arg(gwi, "int", "i[][]")) + GWI_B(gwi_func_arg(gwi, "Int", "i")) + GWI_B(gwi_func_end(gwi, (f_xfun)1, ae_flag_none)) return GW_OK; } diff --git a/tests/plug/func_fail2.c b/tests/plug/func_fail2.c index 72d631e9..a50a045a 100644 --- a/tests/plug/func_fail2.c +++ b/tests/plug/func_fail2.c @@ -10,9 +10,9 @@ #include "instr.h" GWION_IMPORT(func_fail2) { - GWI_BB(gwi_func_ini(gwi, ":[int]Ptr", "test")) - GWI_BB(gwi_func_arg(gwi, "int", "i[][]")) - GWI_BB(gwi_func_arg(gwi, "int", "me")) - GWI_BB(gwi_func_end(gwi, (f_xfun)1, ae_flag_none)) + GWI_B(gwi_func_ini(gwi, ":[int]Ptr", "test")) + GWI_B(gwi_func_arg(gwi, "int", "i[][]")) + GWI_B(gwi_func_arg(gwi, "int", "me")) + GWI_B(gwi_func_end(gwi, (f_xfun)1, ae_flag_none)) return GW_OK; } diff --git a/tests/plug/func_fail3.c b/tests/plug/func_fail3.c index 6dbe5912..4cd99ff5 100644 --- a/tests/plug/func_fail3.c +++ b/tests/plug/func_fail3.c @@ -10,9 +10,9 @@ #include "instr.h" GWION_IMPORT(func_fail3) { - 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)) + GWI_B(gwi_func_ini(gwi, "Ptr:[int]", "test:[A]")) + GWI_B(gwi_func_ini(gwi, "int", "test")) + GWI_B(gwi_func_arg(gwi, "int", "i[][]")) + GWI_B(gwi_func_end(gwi, (f_xfun)1, ae_flag_none)) return GW_OK; } diff --git a/tests/plug/func_fail4.c b/tests/plug/func_fail4.c index 33bd39b6..31800271 100644 --- a/tests/plug/func_fail4.c +++ b/tests/plug/func_fail4.c @@ -10,8 +10,8 @@ #include "instr.h" GWION_IMPORT(func_fail4) { - GWI_BB(gwi_func_ini(gwi, "Ptr:[int]", "test:[A]")) - GWI_BB(gwi_func_arg(gwi, "int", "i[][]")) + GWI_B(gwi_func_ini(gwi, "Ptr:[int]", "test:[A]")) + GWI_B(gwi_func_arg(gwi, "int", "i[][]")) GWI_BB(gwi_item_end(gwi, ae_flag_none, num, 0)) return GW_OK; } diff --git a/tests/plug/func_subscript_not_empty.c b/tests/plug/func_subscript_not_empty.c index 66b3f14f..3ae715a1 100644 --- a/tests/plug/func_subscript_not_empty.c +++ b/tests/plug/func_subscript_not_empty.c @@ -10,7 +10,7 @@ #include "instr.h" GWION_IMPORT(func_subscript_not_empty) { - GWI_BB(gwi_func_ini(gwi, "int[]", "test")) - GWI_BB(gwi_func_end(gwi, (f_xfun)1, ae_flag_none)) + GWI_B(gwi_func_ini(gwi, "int[]", "test")) + GWI_B(gwi_func_end(gwi, (f_xfun)1, ae_flag_none)) return GW_OK; } diff --git a/tests/plug/func_tmpl.c b/tests/plug/func_tmpl.c index 61e76c3a..8e6f13c4 100644 --- a/tests/plug/func_tmpl.c +++ b/tests/plug/func_tmpl.c @@ -12,8 +12,8 @@ static SFUN(func_tmpl_xfun) {} GWION_IMPORT(func_tmpl) { - 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)) + GWI_B(gwi_func_ini(gwi, "int", "test:[A]")) + GWI_B(gwi_func_arg(gwi, "A", "i")) + GWI_B(gwi_func_end(gwi, func_tmpl_xfun, ae_flag_none)) return GW_OK; } diff --git a/tests/plug/func_tmpl_fail.c b/tests/plug/func_tmpl_fail.c index 1eef6c8a..803f7a8c 100644 --- a/tests/plug/func_tmpl_fail.c +++ b/tests/plug/func_tmpl_fail.c @@ -12,7 +12,7 @@ static SFUN(func_tmpl_xfun) {} GWION_IMPORT(func_tmpl_fail) { - GWI_BB(gwi_func_ini(gwi, "voit", "test:[A]")) - GWI_BB(gwi_func_end(gwi, func_tmpl_xfun, ae_flag_none)) + GWI_B(gwi_func_ini(gwi, "voit", "test:[A]")) + GWI_B(gwi_func_end(gwi, func_tmpl_xfun, ae_flag_none)) return GW_OK; } diff --git a/tests/plug/func_too_many_arg.c b/tests/plug/func_too_many_arg.c index 80d30711..98641d27 100644 --- a/tests/plug/func_too_many_arg.c +++ b/tests/plug/func_too_many_arg.c @@ -10,25 +10,25 @@ #include "instr.h" GWION_IMPORT(func_too_many_arg) { - GWI_BB(gwi_func_ini(gwi, "int", "test")) - 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_arg(gwi, "int", "m")) - GWI_BB(gwi_func_arg(gwi, "int", "n")) - GWI_BB(gwi_func_arg(gwi, "int", "o")) - GWI_BB(gwi_func_arg(gwi, "int", "p")) - GWI_BB(gwi_func_arg(gwi, "int", "q")) - GWI_BB(gwi_func_arg(gwi, "int", "r")) - GWI_BB(gwi_func_arg(gwi, "int", "s")) - GWI_BB(gwi_func_arg(gwi, "int", "t")) - GWI_BB(gwi_func_arg(gwi, "int", "u")) - GWI_BB(gwi_func_arg(gwi, "int", "v")) - GWI_BB(gwi_func_arg(gwi, "int", "w")) - GWI_BB(gwi_func_arg(gwi, "int", "x")) - GWI_BB(gwi_func_arg(gwi, "int", "y")) - GWI_BB(gwi_func_arg(gwi, "int", "z")) - GWI_BB(gwi_func_end(gwi, (f_xfun)1, ae_flag_none)) + GWI_B(gwi_func_ini(gwi, "int", "test")) + GWI_B(gwi_func_arg(gwi, "int", "i")) + GWI_B(gwi_func_arg(gwi, "int", "j")) + GWI_B(gwi_func_arg(gwi, "int", "k")) + GWI_B(gwi_func_arg(gwi, "int", "l")) + GWI_B(gwi_func_arg(gwi, "int", "m")) + GWI_B(gwi_func_arg(gwi, "int", "n")) + GWI_B(gwi_func_arg(gwi, "int", "o")) + GWI_B(gwi_func_arg(gwi, "int", "p")) + GWI_B(gwi_func_arg(gwi, "int", "q")) + GWI_B(gwi_func_arg(gwi, "int", "r")) + GWI_B(gwi_func_arg(gwi, "int", "s")) + GWI_B(gwi_func_arg(gwi, "int", "t")) + GWI_B(gwi_func_arg(gwi, "int", "u")) + GWI_B(gwi_func_arg(gwi, "int", "v")) + GWI_B(gwi_func_arg(gwi, "int", "w")) + GWI_B(gwi_func_arg(gwi, "int", "x")) + GWI_B(gwi_func_arg(gwi, "int", "y")) + GWI_B(gwi_func_arg(gwi, "int", "z")) + GWI_B(gwi_func_end(gwi, (f_xfun)1, ae_flag_none)) return GW_OK; } diff --git a/tests/plug/global_func.c b/tests/plug/global_func.c index 1494d3d3..f5e8e392 100644 --- a/tests/plug/global_func.c +++ b/tests/plug/global_func.c @@ -15,8 +15,8 @@ SFUN(coverage_int) { } GWION_IMPORT(global_func) { - GWI_BB(gwi_func_ini(gwi, "int", "test")) - GWI_BB(gwi_func_arg(gwi, "int", "i")) - GWI_BB(gwi_func_end(gwi, coverage_int, ae_flag_none)) + GWI_B(gwi_func_ini(gwi, "int", "test")) + GWI_B(gwi_func_arg(gwi, "int", "i")) + GWI_B(gwi_func_end(gwi, coverage_int, ae_flag_none)) return GW_OK; } diff --git a/tests/plug/invalid_arg.c b/tests/plug/invalid_arg.c index 4739c9d8..a52a33e5 100644 --- a/tests/plug/invalid_arg.c +++ b/tests/plug/invalid_arg.c @@ -11,9 +11,9 @@ static MFUN(test_mfun) {} GWION_IMPORT(invalid_arg) { GWI_OB(gwi_class_ini(gwi, "InvalidArg", NULL)) - GWI_BB(gwi_func_ini(gwi, "int[]", "func")) - GWI_BB(gwi_func_arg(gwi, ".int", "i")) - GWI_BB(gwi_func_end(gwi, test_mfun, ae_flag_static)) - GWI_BB(gwi_class_end(gwi)) + GWI_B(gwi_func_ini(gwi, "int[]", "func")) + GWI_B(gwi_func_arg(gwi, ".int", "i")) + GWI_B(gwi_func_end(gwi, test_mfun, ae_flag_static)) + GWI_B(gwi_class_end(gwi)) return GW_OK; } diff --git a/tests/plug/invalid_array.c b/tests/plug/invalid_array.c index 12d841b1..6763bd96 100644 --- a/tests/plug/invalid_array.c +++ b/tests/plug/invalid_array.c @@ -11,24 +11,24 @@ static MFUN(test_mfun) {} GWION_IMPORT(invalid_array) { GWI_OB(gwi_class_ini(gwi, "InvalidArray", NULL)) - GWI_BB(gwi_func_ini(gwi, "int[]", "func")) - 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, test_mfun, ae_flag_static)) + GWI_B(gwi_func_ini(gwi, "int[]", "func")) + GWI_B(gwi_func_arg(gwi, "int[][]", "i")) + GWI_B(gwi_func_arg(gwi, "int", "j[]")) + GWI_B(gwi_func_arg(gwi, "int[]", "k[]")) + GWI_B(gwi_func_arg(gwi, "int", "l")) + GWI_B(gwi_func_end(gwi, test_mfun, ae_flag_static)) - GWI_BB(gwi_func_ini(gwi, "int[]", "func")) - 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, test_mfun, ae_flag_static)) + GWI_B(gwi_func_ini(gwi, "int[]", "func")) + GWI_B(gwi_func_arg(gwi, "int", "j[][]")) + GWI_B(gwi_func_arg(gwi, "int[]", "+k[][][]")) + GWI_B(gwi_func_arg(gwi, "int", "l")) + GWI_B(gwi_func_end(gwi, test_mfun, ae_flag_static)) - GWI_BB(gwi_func_ini(gwi, "int[]", "func")) - GWI_BB(gwi_func_arg(gwi, "+int", "j[][]")) - GWI_BB(gwi_func_arg(gwi, "int[]", "+k[][][]")) - GWI_BB(gwi_func_end(gwi, test_mfun, ae_flag_static)) + GWI_B(gwi_func_ini(gwi, "int[]", "func")) + GWI_B(gwi_func_arg(gwi, "+int", "j[][]")) + GWI_B(gwi_func_arg(gwi, "int[]", "+k[][][]")) + GWI_B(gwi_func_end(gwi, test_mfun, ae_flag_static)) - GWI_BB(gwi_class_end(gwi)) + GWI_B(gwi_class_end(gwi)) return GW_OK; } diff --git a/tests/plug/invalid_func.c b/tests/plug/invalid_func.c index c2a6e89f..171f3915 100644 --- a/tests/plug/invalid_func.c +++ b/tests/plug/invalid_func.c @@ -11,9 +11,9 @@ static MFUN(test_mfun) {} GWION_IMPORT(invalid_func) { GWI_OB(gwi_class_ini(gwi, "t_invalid_var_type", NULL)) - GWI_BB(gwi_func_ini(gwi, ".int", "i")) - GWI_BB(gwi_func_end(gwi, test_mfun, ae_flag_static)) + GWI_B(gwi_func_ini(gwi, ".int", "i")) + GWI_B(gwi_func_end(gwi, test_mfun, ae_flag_static)) - GWI_BB(gwi_class_end(gwi)) + GWI_B(gwi_class_end(gwi)) return GW_OK; } diff --git a/tests/plug/invalid_type1.c b/tests/plug/invalid_type1.c index b735d716..c5041b0d 100644 --- a/tests/plug/invalid_type1.c +++ b/tests/plug/invalid_type1.c @@ -12,6 +12,6 @@ GWION_IMPORT(invalid_type1) { GWI_OB(gwi_class_ini(gwi, "invalid_var_type", NULL)) GWI_BB(gwi_item_ini(gwi, "i|nt", "test")) GWI_BB(gwi_item_end(gwi, 0, num, 0)) - GWI_BB(gwi_class_end(gwi)) + GWI_B(gwi_class_end(gwi)) return GW_OK; } diff --git a/tests/plug/invalid_type2.c b/tests/plug/invalid_type2.c index 78b624bb..25051228 100644 --- a/tests/plug/invalid_type2.c +++ b/tests/plug/invalid_type2.c @@ -12,6 +12,6 @@ GWION_IMPORT(invalid_type2) { GWI_OB(gwi_class_ini(gwi, "invalid_var_type", NULL)) GWI_BB(gwi_item_ini(gwi, ".int", "test")) GWI_BB(gwi_item_end(gwi, 0, num, 0)) - GWI_BB(gwi_class_end(gwi)) + GWI_B(gwi_class_end(gwi)) return GW_OK; } diff --git a/tests/plug/invalid_type3.c b/tests/plug/invalid_type3.c index 4c820386..884498e8 100644 --- a/tests/plug/invalid_type3.c +++ b/tests/plug/invalid_type3.c @@ -12,6 +12,6 @@ GWION_IMPORT(invalid_type3) { GWI_OB(gwi_class_ini(gwi, "InvalidVarType", NULL)) GWI_BB(gwi_item_ini(gwi, ".int", "test")) GWI_BB(gwi_item_end(gwi, 0, num, 0)) - GWI_BB(gwi_class_end(gwi)) + GWI_B(gwi_class_end(gwi)) return GW_OK; } diff --git a/tests/plug/not_importing.c b/tests/plug/not_importing.c index beb3cce5..3837c3cf 100644 --- a/tests/plug/not_importing.c +++ b/tests/plug/not_importing.c @@ -9,6 +9,6 @@ #include "import.h" GWION_IMPORT(not_importing) { - GWI_BB(gwi_enum_add(gwi, "adc", 0)) + GWI_B(gwi_enum_add(gwi, "adc", 0)) return GW_OK; } diff --git a/tests/plug/str2decl.c b/tests/plug/str2decl.c index 72ee0089..343ea77c 100644 --- a/tests/plug/str2decl.c +++ b/tests/plug/str2decl.c @@ -13,8 +13,8 @@ GWION_IMPORT(str2decl) { GWI_OB(gwi_class_ini(gwi, "Test", NULL)) GWI_OB(gwi_class_ini(gwi, "Child", NULL)) - GWI_BB(gwi_class_end(gwi)) - GWI_BB(gwi_class_end(gwi)) + GWI_B(gwi_class_end(gwi)) + GWI_B(gwi_class_end(gwi)) GWI_OB(gwi_class_ini(gwi, "Test2", "Test.Child")) return gwi_class_end(gwi); } diff --git a/tests/plug/struct.c b/tests/plug/struct.c index 6f767ae4..1cddd7aa 100644 --- a/tests/plug/struct.c +++ b/tests/plug/struct.c @@ -14,10 +14,10 @@ SFUN(coverage_float) { *(m_float *)RETURN = 0; } GWION_IMPORT(struct) { GWI_OB(gwi_struct_ini(gwi, "Struct")) - GWI_BB(gwi_func_ini(gwi, "int", "i")) - GWI_BB(gwi_func_end(gwi, coverage_int, ae_flag_static)) - GWI_BB(gwi_func_ini(gwi, "float", "f")) - GWI_BB(gwi_func_end(gwi, coverage_float, ae_flag_static)) + GWI_B(gwi_func_ini(gwi, "int", "i")) + GWI_B(gwi_func_end(gwi, coverage_int, ae_flag_static)) + GWI_B(gwi_func_ini(gwi, "float", "f")) + GWI_B(gwi_func_end(gwi, coverage_float, ae_flag_static)) GWI_BB(gwi_item_end(gwi, ae_flag_static, num, 5)) @@ -33,6 +33,6 @@ GWION_IMPORT(struct) { GWI_BB(gwi_item_ini(gwi, "int[][]", "test_array")) GWI_BB(gwi_item_end(gwi, ae_flag_none, obj, NULL)) - GWI_BB(gwi_struct_end(gwi)) + GWI_B(gwi_struct_end(gwi)) return GW_OK; } diff --git a/tests/plug/template_arg.c b/tests/plug/template_arg.c index ab585e6b..0066599a 100644 --- a/tests/plug/template_arg.c +++ b/tests/plug/template_arg.c @@ -11,9 +11,9 @@ static MFUN(template_arg_fun) {} GWION_IMPORT(template_arg) { GWI_OB(gwi_class_ini(gwi, "TemplateArg", NULL)) - GWI_BB(gwi_func_ini(gwi, "int", "set")) - GWI_BB(gwi_func_arg(gwi, "Pair,float>", "test")) - GWI_BB(gwi_func_end(gwi, template_arg_fun, ae_flag_none)) - GWI_BB(gwi_class_end(gwi)) + GWI_B(gwi_func_ini(gwi, "int", "set")) + GWI_B(gwi_func_arg(gwi, "Pair,float>", "test")) + GWI_B(gwi_func_end(gwi, template_arg_fun, ae_flag_none)) + GWI_B(gwi_class_end(gwi)) return GW_OK; } diff --git a/tests/plug/typedef_fail.c b/tests/plug/typedef_fail.c index 08aed56e..b3fb207d 100644 --- a/tests/plug/typedef_fail.c +++ b/tests/plug/typedef_fail.c @@ -9,7 +9,7 @@ #include "import.h" GWION_IMPORT(typedef_fail) { - GWI_BB(gwi_typedef_ini(gwi, "int", "Typedef:[A]")) - GWI_BB(gwi_typedef_ini(gwi, "int", "Typedef:[A]")) + GWI_B(gwi_typedef_ini(gwi, "int", "Typedef:[A]")) + GWI_B(gwi_typedef_ini(gwi, "int", "Typedef:[A]")) return GW_OK; } diff --git a/tests/plug/typedef_tmpl.c b/tests/plug/typedef_tmpl.c index 26818f1d..b13fa4a1 100644 --- a/tests/plug/typedef_tmpl.c +++ b/tests/plug/typedef_tmpl.c @@ -9,7 +9,7 @@ #include "import.h" GWION_IMPORT(typedef_tmpl) { - GWI_BB(gwi_typedef_ini(gwi, "Ptr:[A]", "Typedef:[A]")) + GWI_B(gwi_typedef_ini(gwi, "Ptr:[A]", "Typedef:[A]")) GWI_OB(gwi_typedef_end(gwi, ae_flag_none)) return GW_OK; } diff --git a/tests/plug/union.c b/tests/plug/union.c index 951ee971..e6d63ea8 100644 --- a/tests/plug/union.c +++ b/tests/plug/union.c @@ -9,9 +9,9 @@ #include "import.h" GWION_IMPORT(union) { - GWI_BB(gwi_union_ini(gwi, "U")) - GWI_BB(gwi_union_add(gwi, "float", "f")) - GWI_BB(gwi_union_add(gwi, "int", "i")) - GWI_OB(gwi_union_end(gwi, 0)) + GWI_B(gwi_union_ini(gwi, "U")) + GWI_B(gwi_union_add(gwi, "float", "f")) + GWI_B(gwi_union_add(gwi, "int", "i")) + GWI_B(gwi_union_end(gwi, 0)) return GW_OK; } diff --git a/tests/plug/union_fail_exp.c b/tests/plug/union_fail_exp.c index 7ec37364..c0d8dc21 100644 --- a/tests/plug/union_fail_exp.c +++ b/tests/plug/union_fail_exp.c @@ -9,9 +9,9 @@ #include "import.h" GWION_IMPORT(union_fail_exp) { - GWI_BB(gwi_union_ini(gwi, "U")) - GWI_BB(gwi_union_add(gwi, "Float", "f")) - GWI_BB(gwi_union_add(gwi, "int", "i")) - GWI_OB(gwi_union_end(gwi, 0)) + GWI_B(gwi_union_ini(gwi, "U")) + GWI_B(gwi_union_add(gwi, "Float", "f")) + GWI_B(gwi_union_add(gwi, "int", "i")) + GWI_B(gwi_union_end(gwi, 0)) return GW_OK; } diff --git a/tests/plug/union_member.c b/tests/plug/union_member.c index 2c207a03..52982d70 100644 --- a/tests/plug/union_member.c +++ b/tests/plug/union_member.c @@ -10,10 +10,10 @@ GWION_IMPORT(union_member) { GWI_OB(gwi_class_ini(gwi, "UnionMember", NULL)) - GWI_BB(gwi_union_ini(gwi, "U")) - GWI_BB(gwi_union_add(gwi, "float", "f")) - GWI_BB(gwi_union_add(gwi, "int[]", "array")) - GWI_OB(gwi_union_end(gwi, ae_flag_none)) - GWI_BB(gwi_class_end(gwi)) + GWI_B(gwi_union_ini(gwi, "U")) + GWI_B(gwi_union_add(gwi, "float", "f")) + GWI_B(gwi_union_add(gwi, "int[]", "array")) + GWI_B(gwi_union_end(gwi, ae_flag_none)) + GWI_B(gwi_class_end(gwi)) return GW_OK; } diff --git a/tests/plug/union_name.c b/tests/plug/union_name.c index bf752294..6581666a 100644 --- a/tests/plug/union_name.c +++ b/tests/plug/union_name.c @@ -9,9 +9,9 @@ #include "import.h" GWION_IMPORT(union_name) { - GWI_BB(gwi_union_ini(gwi, "my_union")) - GWI_BB(gwi_union_add(gwi, "float", "f")) - GWI_BB(gwi_union_add(gwi, "int", "i")) - GWI_OB(gwi_union_end(gwi, 0)) + GWI_B(gwi_union_ini(gwi, "my_union")) + GWI_B(gwi_union_add(gwi, "float", "f")) + GWI_B(gwi_union_add(gwi, "int", "i")) + GWI_B(gwi_union_end(gwi, 0)) return GW_OK; } diff --git a/tests/plug/union_tmpl.c b/tests/plug/union_tmpl.c index 9e4ced33..aa632147 100644 --- a/tests/plug/union_tmpl.c +++ b/tests/plug/union_tmpl.c @@ -9,10 +9,10 @@ #include "import.h" GWION_IMPORT(union_tmpl) { - GWI_BB(gwi_union_ini(gwi, "U:[A]")) - 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_OB(gwi_union_end(gwi, 0)) + GWI_B(gwi_union_ini(gwi, "U:[A]")) + GWI_B(gwi_union_add(gwi, "float", "f")) + GWI_B(gwi_union_add(gwi, "int", "i")) + GWI_B(gwi_union_add(gwi, "A", "a")) + GWI_B(gwi_union_end(gwi, 0)) return GW_OK; } diff --git a/tests/plug/union_tmpl_fail.c b/tests/plug/union_tmpl_fail.c index 25662a6c..ed100d38 100644 --- a/tests/plug/union_tmpl_fail.c +++ b/tests/plug/union_tmpl_fail.c @@ -9,10 +9,10 @@ #include "import.h" GWION_IMPORT(union_tmpl_fail) { - GWI_BB(gwi_union_ini(gwi, "U:[A]")) - 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_OB(gwi_union_end(gwi, 0)) + GWI_B(gwi_union_ini(gwi, "U:[A]")) + GWI_B(gwi_union_add(gwi, "float", "f")) + GWI_B(gwi_union_add(gwi, "int", "i")) + GWI_B(gwi_union_add(gwi, "A", "a")) + GWI_B(gwi_union_end(gwi, 0)) return GW_OK; } diff --git a/tests/plug/union_tmpl_fail2.c b/tests/plug/union_tmpl_fail2.c index 75c80e92..5f5f82dc 100644 --- a/tests/plug/union_tmpl_fail2.c +++ b/tests/plug/union_tmpl_fail2.c @@ -9,11 +9,11 @@ #include "import.h" GWION_IMPORT(union_tmpl_fail2) { - GWI_BB(gwi_union_ini(gwi, "U:[A]")) - 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, "U:[A]")) - GWI_OB(gwi_union_end(gwi, 0)) + GWI_B(gwi_union_ini(gwi, "U:[A]")) + GWI_B(gwi_union_add(gwi, "float", "f")) + GWI_B(gwi_union_add(gwi, "int", "i")) + GWI_B(gwi_union_add(gwi, "A", "a")) + GWI_B(gwi_union_ini(gwi, "U:[A]")) + GWI_B(gwi_union_end(gwi, 0)) return GW_OK; } diff --git a/tests/plug/union_tmpl_fail3.c b/tests/plug/union_tmpl_fail3.c index 94e5a1a4..32f2b09f 100644 --- a/tests/plug/union_tmpl_fail3.c +++ b/tests/plug/union_tmpl_fail3.c @@ -9,10 +9,10 @@ #include "import.h" GWION_IMPORT(union_tmpl_fail3) { - GWI_BB(gwi_union_ini(gwi, "U:[A]")) - 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_OB(gwi_union_end(gwi, 0)) + GWI_B(gwi_union_ini(gwi, "U:[A]")) + GWI_B(gwi_union_add(gwi, "float", "f")) + GWI_B(gwi_union_add(gwi, "int", "i")) + GWI_B(gwi_union_add(gwi, "A", "a")) + GWI_B(gwi_union_end(gwi, 0)) return GW_OK; } diff --git a/tests/plug/vm_remove.c b/tests/plug/vm_remove.c index e4fe8694..30348102 100644 --- a/tests/plug/vm_remove.c +++ b/tests/plug/vm_remove.c @@ -12,8 +12,8 @@ SFUN(coverage_int) { vm_remove(shred->info->vm, *(m_int *)MEM(0)); } GWION_IMPORT(vm_remove) { - GWI_BB(gwi_func_ini(gwi, "int", "test")) - GWI_BB(gwi_func_arg(gwi, "int", "i")) - GWI_BB(gwi_func_end(gwi, coverage_int, ae_flag_none)) + GWI_B(gwi_func_ini(gwi, "int", "test")) + GWI_B(gwi_func_arg(gwi, "int", "i")) + GWI_B(gwi_func_end(gwi, coverage_int, ae_flag_none)) return GW_OK; } -- 2.43.0