File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -1186,6 +1186,23 @@ namespace Sass {
1186
1186
return operator ==(&rhs);
1187
1187
}
1188
1188
1189
+ bool Number::operator < (Number* rhs) const
1190
+ {
1191
+ Number tmp_r (*rhs);
1192
+ tmp_r.normalize (find_convertible_unit ());
1193
+ string l_unit (unit ());
1194
+ string r_unit (tmp_r.unit ());
1195
+ if (!l_unit.empty () && !r_unit.empty () && unit () != tmp_r.unit ()) {
1196
+ error (" cannot compare numbers with incompatible units" , pstate ());
1197
+ }
1198
+ return value () < tmp_r.value ();
1199
+ }
1200
+
1201
+ bool Number::operator < (Number& rhs) const
1202
+ {
1203
+ return operator <(&rhs);
1204
+ }
1205
+
1189
1206
bool String_Quoted::operator == (Expression* rhs) const
1190
1207
{
1191
1208
if (String_Quoted* qstr = dynamic_cast <String_Quoted*>(rhs)) {
Original file line number Diff line number Diff line change @@ -1192,6 +1192,8 @@ namespace Sass {
1192
1192
// useful for making one number compatible with another
1193
1193
string find_convertible_unit () const ;
1194
1194
1195
+ virtual bool operator < (Number& rhs) const ;
1196
+ virtual bool operator < (Number* rhs) const ;
1195
1197
virtual bool operator == (Expression& rhs) const ;
1196
1198
virtual bool operator == (Expression* rhs) const ;
1197
1199
You can’t perform that action at this time.
0 commit comments