50 s = lhs->get_string();
51 l = rhs->get_string();
56 <<
"incompatible types between "
60 <<
" for operator '~=', '^=', '$=', '*=', '|='."
62 return lhs->get_string() == rhs->get_string();
74 if(l.length() < s.length())
78 return s == l.substr(0, s.length());
81 if(l.length() < s.length())
85 return s == l.substr(l.length() - s.length());
100 return l.find(s) != std::string::npos;
105 switch(n->get_type())
115 return n->get_type();
119 if(n->get_string() ==
"not-equal")
124#if __cplusplus >= 201700
149 if(lhs->get_string() == rhs->get_string())
159 <<
"incompatible types or dimensions between "
163 <<
" for operator '=', '!=', '<', '<=', '>', '>=', '~=', '^=', '$=', '*=', or '|='."
174 return lhs->get_boolean() == rhs->get_boolean();
177 return lhs->get_integer() == rhs->get_integer();
180#pragma GCC diagnostic push
181#pragma GCC diagnostic ignored "-Wfloat-equal"
182 return lhs->get_integer() == rhs->get_decimal_number();
183#pragma GCC diagnostic pop
186#pragma GCC diagnostic push
187#pragma GCC diagnostic ignored "-Wfloat-equal"
188 return lhs->get_decimal_number() == rhs->get_integer();
189#pragma GCC diagnostic pop
192#pragma GCC diagnostic push
193#pragma GCC diagnostic ignored "-Wfloat-equal"
194 return lhs->get_decimal_number() == rhs->get_decimal_number();
195#pragma GCC diagnostic pop
198#pragma GCC diagnostic push
199#pragma GCC diagnostic ignored "-Wfloat-equal"
200 return lhs->get_decimal_number() == rhs->get_decimal_number();
201#pragma GCC diagnostic pop
204 return lhs->get_string() == rhs->get_string();
208 color const lc(lhs->get_color());
209 color const rc(rhs->get_color());
216 throw csspp_exception_logic(
"expression.cpp:include_match(): called with an invalid set of node types.");
251 bool boolean_result(
false);
257 boolean_result =
is_equal(result, rhs);
261 boolean_result = !
is_equal(result, rhs);
269 boolean_result = match(op, result, rhs);
277 result->set_boolean(boolean_result);
rgba_color_t get_color() const
static error & instance()
node::pointer_t equality()
node::pointer_t f_current
node::pointer_t relational()
bool is_comparable(node::pointer_t lhs, node::pointer_t rhs)
bool is_equal(node::pointer_t lhs, node::pointer_t rhs)
std::shared_ptr< node > pointer_t
bool match(node_type_t op, node::pointer_t lhs, node::pointer_t rhs)
node_type_t equality_operator(node::pointer_t n)
The namespace of all the classes in the CSS Preprocessor.
int32_t constexpr mix_node_types(node_type_t a, node_type_t b)