Skip to content

Commit a88848f

Browse files
committed
Update list equality to take delimiters into account
Bracketed lists introduce an `is_bracketed` attribute to lists. Whether a list is bracketed needs be taken into account when determining equality. See sass/sass#2121 Fixes #2280 Spec sass/sass-spec#896
1 parent 01074d8 commit a88848f

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/ast.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -2225,6 +2225,7 @@ namespace Sass {
22252225
if (List_Ptr_Const r = dynamic_cast<List_Ptr_Const>(&rhs)) {
22262226
if (length() != r->length()) return false;
22272227
if (separator() != r->separator()) return false;
2228+
if (is_bracketed() != r->is_bracketed()) return false;
22282229
for (size_t i = 0, L = length(); i < L; ++i) {
22292230
Expression_Obj rv = r->at(i);
22302231
Expression_Obj lv = this->at(i);

src/ast.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -1082,6 +1082,7 @@ namespace Sass {
10821082
{
10831083
if (hash_ == 0) {
10841084
hash_ = std::hash<std::string>()(sep_string());
1085+
if (is_bracketed()) hash_combine(hash_, std::hash<std::string>()("bracket"));
10851086
for (size_t i = 0, L = length(); i < L; ++i)
10861087
hash_combine(hash_, (elements()[i])->hash());
10871088
}

0 commit comments

Comments
 (0)