-Subproject commit d5bb42177b8cc84c6fa225c93a79b84cb9c75840
+Subproject commit aad27af27cd58925dfde26a7c9d6cfad3a9594b3
(_exp_func)prefix##_exp_decl, (_exp_func)prefix##_exp_binary, (_exp_func)prefix##_exp_unary, \
(_exp_func)prefix##_exp_primary, (_exp_func)prefix##_exp_cast, (_exp_func)prefix##_exp_post, \
(_exp_func)prefix##_exp_call, (_exp_func)prefix##_exp_array, (_exp_func)prefix##_exp_if, \
- (_exp_func)prefix##_exp_dot, (_exp_func)prefix##_exp_dur, (_exp_func)prefix##_exp_lambda \
+ (_exp_func)prefix##_exp_dot, (_exp_func)prefix##_exp_lambda \
};
#define DECL_SECTION_FUNC(prefix) \
return op_emit(emit, &opi);
}
-ANN static m_bool emit_exp_dur(const Emitter emit, const Exp_Dur* dur) { GWDEBUG_EXE
- CHECK_BB(emit_exp(emit, dur->base, 0))
- CHECK_BB(emit_exp(emit, dur->unit, 0))
- emit_add_instr(emit, FloatTimes);
- return GW_OK;
-}
-
ANN static m_bool is_special(const Type t) {
if(isa(t, t_complex) > 0 || isa(t, t_polar) > 0 ||
isa(t, t_vec3) > 0 || isa(t, t_vec4) > 0 ||
CHECK_FF(not, unary_meta, not)
CHECK_BB(gwi_oper_ini(gwi, NULL, "dur", "int"))
CHECK_FF(not, unary_meta, not)
+ CHECK_BB(gwi_oper_ini(gwi, "int", "dur", "dur"))
+ CHECK_BB(gwi_oper_end(gwi, op_coloncolon, int_float_mul))
+ CHECK_BB(gwi_oper_ini(gwi, "float", "dur", "dur"))
+ CHECK_BB(gwi_oper_end(gwi, op_coloncolon, FloatTimes))
return GW_OK;
}
OP_RET(post, "postfix");
}
-ANN static Type check_exp_dur(const Env env, const Exp_Dur* exp) { GWDEBUG_EXE
- CHECK_OO(check_exp(env, exp->base))
- CHECK_OO(check_exp(env, exp->unit))
- if(isa(exp->base->type, t_float) < 0) {
- if(isa(exp->base->type, t_int) > 0)
- exp->base->cast_to = t_float;
- else
- ERR_O(exp->base->pos, "invalid type '%s' in prefix of dur expression...\n"
- " (must be of type 'int' or 'float')", exp->base->type->name)
- }
- if(isa(exp->unit->type, t_dur) < 0)
- ERR_O(exp->unit->pos, "invalid type '%s' in postfix of dur expression...\n"
- " (must be of type 'dur')", exp->base->type->name)
- return exp->unit->type;
-}
-
ANN static Type check_exp_call(const Env env, Exp_Call* exp) { GWDEBUG_EXE
if(exp->tmpl) {
CHECK_OO(check_exp(env, exp->func))
(_type_func)check_exp_decl, (_type_func)check_exp_binary, (_type_func)check_exp_unary,
(_type_func)check_exp_primary, (_type_func)check_exp_cast, (_type_func)check_exp_post,
(_type_func)check_exp_call, (_type_func)check_exp_array, (_type_func)check_exp_if,
- (_type_func)check_exp_dot, (_type_func)check_exp_dur, (_type_func)check_exp_lambda
+ (_type_func)check_exp_dot, (_type_func)check_exp_lambda
};
ANN static inline Type check_exp(const Env env, const Exp exp) { GWDEBUG_EXE
" on non-mutable data-type...", op2str(post->op));
}
-ANN static inline m_bool scan1_exp_dur(const Env env, const Exp_Dur* dur) { GWDEBUG_EXE
- CHECK_BB(scan1_exp(env, dur->base))
- return scan1_exp(env, dur->unit);
-}
-
ANN static m_bool scan1_exp_call(const Env env, const Exp_Call* exp_call) { GWDEBUG_EXE
if(exp_call->tmpl)
return GW_OK;
return scan2_exp(env, post->exp);
}
-ANN static inline m_bool scan2_exp_dur(const Env env, const Exp_Dur* dur) { GWDEBUG_EXE
- CHECK_BB(scan2_exp(env, dur->base))
- return scan2_exp(env, dur->unit);
-}
-
ANN2(1,2) static inline m_bool scan2_exp_call1(const Env env, const restrict Exp func,
const restrict Exp args) { GWDEBUG_EXE
CHECK_BB(scan2_exp(env, func))
-Subproject commit a25a0c0e88bfdf69041c658ff14f7992d78ddcb4
+Subproject commit 1e9a605aeb73cef2853972984b90e6dc43324d84