ANN Type gwi_fptr_end(const Gwi gwi, const ae_flag flag) {
const Fptr_Def fptr = import_fptr(gwi, &gwi->func, flag);
- if(traverse_fptr_def(gwi->gwion->env, fptr) < 0) {
- if(!fptr->type)
- free_fptr_def(gwi->gwion->mp, fptr);
- return NULL;
- }
- SET_FLAG(fptr->base->func, builtin);
- const Type t = fptr->type;
+ const m_bool ret = traverse_fptr_def(gwi->gwion->env, fptr);
+ if(ret > 0)
+ SET_FLAG(fptr->base->func, builtin);
+ const Type t = ret > 0 ? fptr->type : NULL;
free_fptr_def(gwi->gwion->mp, fptr);
return t;
}
udef->flag = flag;
CHECK_BO(traverse_union_def(gwi->gwion->env, udef))
emit_union_offset(udef->l, udef->o);
- if(GET_FLAG(udef, member))
+ if(gwi->gwion->env->class_def && !GET_FLAG(udef, static))
gwi->gwion->env->class_def->nspc->info->offset =
udef->o + udef->s;
const Type t = udef->xid ? udef->value->type :
--- /dev/null
+#include "gwion_util.h"
+#include "gwion_ast.h"
+#include "oo.h"
+#include "vm.h"
+#include "env.h"
+#include "type.h"
+#include "instr.h"
+#include "object.h"
+#include "gwion.h"
+#include "value.h"
+#include "operator.h"
+#include "import.h"
+#include "instr.h"
+
+GWION_IMPORT(too_many_args) {
+ GWI_BB(gwi_func_ini(gwi, "int", "test", (f_xfun)1))
+ 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, 0))
+ return GW_OK;
+}
--- /dev/null
+#include "gwion_util.h"
+#include "gwion_ast.h"
+#include "oo.h"
+#include "vm.h"
+#include "env.h"
+#include "type.h"
+#include "object.h"
+#include "instr.h"
+#include "gwion.h"
+#include "value.h"
+#include "operator.h"
+#include "import.h"
+
+GWION_IMPORT(union_member) {
+ const Type t_unionmember = gwi_mk_type(gwi, "UnionMember", SZ_INT, "Object");
+ GWI_BB(gwi_class_ini(gwi, t_unionmember, NULL, NULL))
+ 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, ae_flag_none))
+ GWI_BB(gwi_class_end(gwi))
+ return GW_OK;
+}