static Boxed_Value const_unary_go(Operators::Opers t_oper, const T &t) { switch (t_oper) { case Operators::unary_minus: return const_var(-t); case Operators::unary_plus: return const_var(+t); default: throw chaiscript::detail::exception::bad_any_cast(); } }
static Boxed_Value const_binary_go(Operators::Opers t_oper, const T &t, const T &u) { switch (t_oper) { case Operators::sum: return const_var(t + u); case Operators::quotient: check_divide_by_zero(u); return const_var(t / u); case Operators::product: return const_var(t * u); case Operators::difference: return const_var(t - u); default: throw chaiscript::detail::exception::bad_any_cast(); } }
static Boxed_Value const_unary_int_go(Operators::Opers t_oper, const T &t) { switch (t_oper) { case Operators::bitwise_complement: return const_var(~t); default: throw chaiscript::detail::exception::bad_any_cast(); } }
static Boxed_Value const_binary_int_go(Operators::Opers t_oper, const T &t, const T &u) { switch (t_oper) { case Operators::shift_left: return const_var(t << u); case Operators::shift_right: return const_var(t >> u); case Operators::remainder: check_divide_by_zero(u); return const_var(t % u); case Operators::bitwise_and: return const_var(t & u); case Operators::bitwise_or: return const_var(t | u); case Operators::bitwise_xor: return const_var(t ^ u); default: throw chaiscript::detail::exception::bad_any_cast(); } }
static Boxed_Value boolean_go(Operators::Opers t_oper, const T &t, const T &u) { switch (t_oper) { case Operators::equals: return const_var(t == u); case Operators::less_than: return const_var(t < u); case Operators::greater_than: return const_var(t > u); case Operators::less_than_equal: return const_var(t <= u); case Operators::greater_than_equal: return const_var(t >= u); case Operators::not_equal: return const_var(t != u); default: throw chaiscript::detail::exception::bad_any_cast(); } }
static Boxed_Value handle(const Ret &r) { return const_var(r); }