71 bool test_dimensions(
true);
85 result->set_string(lhs->get_string() + rhs->get_string());
91 ai = lhs->get_integer();
92 bi = rhs->get_integer();
97 af = lhs->get_decimal_number();
98 bf = rhs->get_decimal_number();
103 af = lhs->get_decimal_number();
110 bf = rhs->get_decimal_number();
115 af = lhs->get_decimal_number();
116 bf = rhs->get_decimal_number();
118 test_dimensions =
false;
125#if __cplusplus >= 201700
130 if(rhs->get_string() ==
"")
139 offset = rhs->get_decimal_number();
141 color c(lhs->get_color());
152 green = offset - green;
153 blue = offset - blue;
154 alpha = offset - alpha;
173 result->set_color(c);
177 <<
"color offsets (numbers added with + or - operators) must be unit less values, "
180 : rhs->get_decimal_number())
182 <<
" is not acceptable."
188 color lc(lhs->get_color());
189 color const rc(rhs->get_color());
198 lc.
get_color(lred, lgreen, lblue, lalpha);
199 rc.
get_color(rred, rgreen, rblue, ralpha);
214 lc.
set_color(lred, lgreen, lblue, lalpha);
216 result->set_color(lc);
231 <<
"incompatible types between "
238 << (subtract ?
"-" :
"+")
246 std::string
const ldim(lhs->get_string());
247 std::string
const rdim(rhs->get_string());
251 <<
"incompatible dimensions: \""
255 <<
"\" cannot be used as is with operator '"
256 << (subtract ?
"-" :
"+")
267 result->set_string(lhs->get_string());
275 result->set_integer(ai - bi);
279 result->set_integer(ai + bi);
287 result->set_decimal_number(af - bf);
291 result->set_decimal_number(af + bf);
296 throw csspp_exception_logic(
"expression.cpp:add(): 'type' set to a value which is not handled here.");