gwi_item_end(gwi, ae_flag_const, hour);
gwi_item_ini(gwi, "time", "t_zero");
gwi_item_end(gwi, ae_flag_const, t_zero);
-// gwi_item_ini(gwi, "@now", "now");
-// gwi_item_end(gwi, ae_flag_const, NULL);
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 env->gwion->type[et_null];
}
return imp->e->cast_to = env->gwion->type[et_float];
}
-// can't it be just declared?
-static OP_EMIT(opem_i2f) {
- return emit_add_instr(emit, CastI2F);
-}
-
-static OP_EMIT(opem_f2i) {
- return emit_add_instr(emit, CastF2I);
-}
-
#define CHECK_FF(op, check, func) _CHECK_OP(op, check, float_##func)
#define CHECK_IF(op, check, func) _CHECK_OP(op, check, int_float_##func)
#define CHECK_FI(op, check, func) _CHECK_OP(op, check, float_int_##func)
CHECK_IF("-=>", rassign, r_minus)
CHECK_IF("*=>", rassign, r_mul)
CHECK_IF("/=>", rassign, r_div)
- GWI_BB(gwi_oper_emi(gwi, opem_i2f))
_CHECK_OP("$", basic_cast, CastI2F)
_CHECK_OP("@implicit", implicit_i2f, CastI2F)
return GW_OK;
CHECK_FI("-=>", rassign, r_minus)
CHECK_FI("*=>", rassign, r_mul)
CHECK_FI("/=>", rassign, r_div)
- GWI_BB(gwi_oper_emi(gwi, opem_f2i))
_CHECK_OP("$", basic_cast, CastF2I)
_CHECK_OP("@implicit", implicit_f2i, CastF2I)
_CHECK_OP("@repeat", repeat_f2i, CastF2I)
const Exp_Unary* unary = (Exp_Unary*)data;
return exp_self(unary)->type = nspc_lookup_type1(unary->exp->type->e->owner, insert_symbol(get_type_name(env, unary->exp->type->name, 1)));
}
-#include "tuple.h"
+
static OP_CHECK(opck_ptr_cast) {
const Exp_Cast* cast = (Exp_Cast*)data;
DECL_ON(const Type, t, = type_decl_resolve(env, cast->td))
assert(t->e->def);
CHECK_BN(traverse_class_def(env, t->e->def))
}
- const Type to = (Type)vector_at(&t->e->tuple->types, 0);
+ const Type to = known_type(env, cast->td->types->td);
if(isa(cast->exp->type, to) > 0)
return t;
ERR_N(exp_self(cast)->pos, "invalid pointer cast")