ae_flag flag;
};
-extern Type t_void, t_int, t_enum, t_bool, t_float, t_dur, t_time, t_now, t_complex, t_polar, t_vec3, t_vec4,
+extern Type t_void, t_int, t_bool, t_float, t_dur, t_time, t_now, t_complex, t_polar, t_vec3, t_vec4,
t_null, t_object, t_shred, t_fork, t_event, t_ugen, t_string, t_ptr, t_array, t_gack,
t_function, t_fptr, t_varloop, t_vararg, t_lambda, t_class, t_union, t_undefined, t_auto, t_tuple;
return GW_OK;
}
-static OP_CHECK(opck_i2enum) {
- struct Implicit* imp = (struct Implicit*)data;
- return imp->e->cast_to = imp->t;
-}
-
static GWION_IMPORT(int_unary) {
GWI_BB(gwi_oper_ini(gwi, NULL, "int", "int"))
GWI_BB(gwi_oper_add(gwi, opck_unary_meta))
return GW_OK;
}
-static GWION_IMPORT(bool) {
- GWI_OB((t_enum = gwi_mk_type(gwi, "@enum", SZ_INT, t_int)))
- GWI_BB(gwi_add_type(gwi, t_enum))
- GWI_BB(gwi_oper_ini(gwi, "int", "@enum", NULL))
- GWI_BB(gwi_oper_add(gwi, opck_i2enum))
- GWI_BB(gwi_oper_end(gwi, "@implicit", NULL))
+static GWION_IMPORT(int_values) {
GWI_BB(gwi_enum_ini(gwi, "bool"))
GWI_BB(gwi_enum_add(gwi, "false", 0))
GWI_BB(gwi_enum_add(gwi, "true", 1))
t_bool = gwi_enum_end(gwi);
+// GWI_BB(gwi_item_ini(gwi, "bool", "maybe"))
+// GWI_BB(gwi_item_end(gwi, 0, NULL))
gwi_reserve(gwi, "maybe");
struct SpecialId_ spid = { .type=t_bool, .exec=RegPushMaybe, .is_const=1 };
gwi_specialid(gwi, "maybe", &spid);
GWI_BB(import_int_op(gwi))
GWI_BB(import_int_logical(gwi))
GWI_BB(import_int_r(gwi))
- return import_int_unary(gwi);
+ GWI_BB(import_int_unary(gwi))
+ return import_int_values(gwi);
}
static GWION_IMPORT(values) {
gwi_specialid(gwi, "now", &spid);
return GW_OK;
}
-
+/*
+static OP_CHECK(opck_chuck_now) {
+ Exp_Binary* bin = (Exp_Binary*)data;
+ ERR_N(exp_self(bin)->pos, _("can't assign 'now' to 'now'"))
+}
+*/
static OP_CHECK(opck_implicit_f2i) {
return t_null;
}
GWI_BB(import_floatint(gwi))
GWI_BB(import_dur(gwi))
GWI_BB(import_time(gwi))
- GWI_BB(import_bool(gwi))
return import_values(gwi);
}
type->name = name;
type->e = mp_calloc(p, TypeInfo);
type->e->parent = parent;
- if(t_object && parent && isa(parent, t_object) > 0) {
+ if(type->e->parent) {
type->size = parent->size;
type->e->tuple = new_tupleform(p);
}
return depth;
}
-Type t_void, t_int, t_enum, t_bool, t_float, t_dur, t_time, t_now, t_complex, t_polar, t_vec3, t_vec4,
+Type t_void, t_int, t_bool, t_float, t_dur, t_time, t_now, t_complex, t_polar, t_vec3, t_vec4,
t_null, t_object, t_shred, t_fork, t_event, t_ugen, t_string, t_ptr, t_array, t_gack,
t_function, t_fptr, t_varloop, t_vararg, t_lambda, t_class, t_union, t_undefined, t_auto, t_tuple;
s_name(edef->xid), v->type->name)
CHECK_BB(scan0_defined(env, edef->xid, edef->pos))
}
- const Type t = type_copy(env->gwion->mp, t_enum);
+ const Type t = type_copy(env->gwion->mp, t_int);
t->xid = ++env->scope->type_xid;
t->name = edef->xid ? s_name(edef->xid) : "int";
- t->e->parent = t_enum;
+ t->e->parent = t_int;
const Nspc nspc = GET_FLAG(edef, global) ? env->global_nspc : env->curr;
t->e->owner = nspc;
edef->t = t;
CHECK_OB(gwi_enum_end(gwi))
Type t_enum;
- CHECK_OB((t_myenum = gwi_mk_type(gwi, "Enum", 0, NULL)))
- CHECK_BB(gwi_class_ini(gwi, t_myenum, NULL, NULL))
+ CHECK_OB((t_enum = gwi_mk_type(gwi, "Enum", 0, NULL)))
+ CHECK_BB(gwi_class_ini(gwi, t_enum, NULL, NULL))
CHECK_BB(gwi_enum_ini(gwi, 0))
CHECK_BB(gwi_enum_add(gwi, "ENUM0", 0))
CHECK_BB(gwi_enum_add(gwi, "ENUM1", 1))