@@ -49,12 +49,12 @@ namespace Sass {
4949
5050 bool Value::_selectorStringOrNull (Logger& logger, sass::string& rv) {
5151
52- if (String_Constant* str = Cast<String_Constant>( this )) {
52+ if (String_Constant* str = isString ( )) {
5353 rv = str->value ();
5454 return true ;
5555 }
5656
57- if (SassList * list = Cast<SassList>( this )) {
57+ if (SassList * list = isList ( )) {
5858
5959 sass::vector<ValueObj> values = list->asVector ();
6060
@@ -63,8 +63,8 @@ namespace Sass {
6363 sass::vector<sass::string> result;
6464 if (list->separator () == SASS_COMMA) {
6565 for (auto complex : values) {
66- SassList* cplxLst = Cast<SassList>( complex );
67- String_Constant* cplxStr = Cast<String_Constant>( complex );
66+ SassList* cplxLst = complex -> isList ( );
67+ String_Constant* cplxStr = complex -> isString ( );
6868 if (cplxStr) {
6969 result.emplace_back (cplxStr->value ());
7070 }
@@ -82,7 +82,7 @@ namespace Sass {
8282 }
8383 else {
8484 for (auto compound : values) {
85- String_Constant* cmpdStr = Cast<String_Constant>(compound );
85+ String_Constant* cmpdStr = compound-> isString ( );
8686 if (cmpdStr) {
8787 result.emplace_back (cmpdStr->value ());
8888 }
@@ -174,7 +174,7 @@ namespace Sass {
174174 // The SassScript `+` operation.
175175 inline Value* Value::plus (
176176 Value* other, Logger& logger, const SourceSpan& pstate) const {
177- if (String_Constant * str = Cast<String_Constant>(other )) {
177+ if (String_Constant * str = other-> isString ( )) {
178178 sass::string text (toCssString () + str->value ());
179179 return SASS_MEMORY_NEW (String_Constant,
180180 pstate, text, str->hasQuotes ());
@@ -263,7 +263,7 @@ namespace Sass {
263263 // at the same key, order is not important.
264264 bool Map::operator == (const Value& rhs) const
265265 {
266- if (const Map* r = Cast<Map>(& rhs)) {
266+ if (const Map* r = rhs. isMap ( )) {
267267 if (size () != r->size ()) return false ;
268268 for (auto kv : elements_) {
269269 auto lv = kv.second ;
@@ -274,7 +274,7 @@ namespace Sass {
274274 }
275275 return true ;
276276 }
277- if (const SassList * r = Cast<SassList>(& rhs)) {
277+ if (const SassList * r = rhs. isList ( )) {
278278 return r->empty () && empty ();
279279 }
280280 return false ;
@@ -415,7 +415,7 @@ namespace Sass {
415415
416416 bool Number::operator == (const Value& rhs) const
417417 {
418- if (const Number* n = Cast<Number>(& rhs)) {
418+ if (const Number* n = rhs. isNumber ( )) {
419419 return *this == *n;
420420 }
421421 return false ;
@@ -574,7 +574,7 @@ namespace Sass {
574574
575575 bool Color_RGBA::operator == (const Value& rhs) const
576576 {
577- if (auto r = Cast<Color_RGBA>(& rhs)) {
577+ if (auto r = rhs. isColorRGBA ( )) {
578578 return r_ == r->r () &&
579579 g_ == r->g () &&
580580 b_ == r->b () &&
@@ -659,7 +659,7 @@ namespace Sass {
659659
660660 bool Color_HSLA::operator == (const Value& rhs) const
661661 {
662- if (auto r = Cast<Color_HSLA>(& rhs)) {
662+ if (auto r = rhs. isColorHSLA ( )) {
663663 return h_ == r->h () &&
664664 s_ == r->s () &&
665665 l_ == r->l () &&
@@ -726,7 +726,7 @@ namespace Sass {
726726
727727 bool Custom_Error::operator == (const Value& rhs) const
728728 {
729- if (auto r = Cast<Custom_Error>(& rhs)) {
729+ if (auto r = rhs. isError ( )) {
730730 return message () == r->message ();
731731 }
732732 return false ;
@@ -741,7 +741,7 @@ namespace Sass {
741741
742742 bool Custom_Warning::operator == (const Value& rhs) const
743743 {
744- if (auto r = Cast<Custom_Warning>(& rhs)) {
744+ if (auto r = rhs. isWarning ( )) {
745745 return message () == r->message ();
746746 }
747747 return false ;
@@ -765,7 +765,7 @@ namespace Sass {
765765
766766 bool Boolean::operator == (const Value& rhs) const
767767 {
768- if (auto r = Cast<Boolean>(& rhs)) {
768+ if (auto r = rhs. isBoolean ( )) {
769769 return (value () == r->value ());
770770 }
771771 return false ;
@@ -794,10 +794,10 @@ namespace Sass {
794794
795795 const sass::string& Interpolation::getInitialPlain () const
796796 {
797- if (StringLiteral * str = Cast<StringLiteral>(first ())) {
797+ if (StringLiteral * str = Cast<StringLiteral>(first ())) { // Ex
798798 return str->text ();
799799 }
800- else if (String_Constant * str = Cast<String_Constant>(first ())) {
800+ else if (String_Constant * str = Cast<String_Constant>(first ())) { // Ex
801801 return str->value ();
802802 }
803803 return empty_string;
@@ -817,7 +817,7 @@ namespace Sass {
817817 using namespace Character ;
818818 bool containsDoubleQuote = false ;
819819 for (auto item : text_->elements ()) {
820- if (auto str = Cast<String_Constant>(item)) {
820+ if (auto str = Cast<String_Constant>(item)) { // Ex
821821 auto & value = str->value ();
822822 for (size_t i = 0 ; i < value.size (); i++) {
823823 uint8_t codeUnit = value[i];
@@ -854,7 +854,7 @@ namespace Sass {
854854
855855 for (auto value : text_->elements ()) {
856856 // assert(value is Expression || value is String);
857- if (StringLiteral * str = Cast<StringLiteral>(value)) {
857+ if (StringLiteral * str = Cast<StringLiteral>(value)) { // Ex
858858 sass::string value (str->text ());
859859 for (size_t i = 0 ; i < value.size (); i++) {
860860
@@ -885,11 +885,8 @@ namespace Sass {
885885
886886 }
887887 }
888- else if (Expression * ex = Cast<Expression>(value)) {
889- buffer.add (ex);
890- }
891888 else {
892- std::cerr << " nono item in schema \n " ;
889+ buffer. add (value) ;
893890 }
894891 }
895892
@@ -1095,7 +1092,7 @@ namespace Sass {
10951092
10961093 bool SassList::operator ==(const Value& rhs) const
10971094 {
1098- if (const SassList* r = Cast<SassList>(& rhs)) {
1095+ if (const SassList* r = rhs. isList ( )) {
10991096 if (length () != r->length ()) return false ;
11001097 if (separator () != r->separator ()) return false ;
11011098 if (hasBrackets () != r->hasBrackets ()) return false ;
@@ -1108,7 +1105,7 @@ namespace Sass {
11081105 }
11091106 return true ;
11101107 }
1111- if (const Map * r = Cast<Map>(& rhs)) {
1108+ if (const Map * r = rhs. isMap ( )) {
11121109 return empty () && r->empty ();
11131110 }
11141111 return false ;
@@ -1183,10 +1180,10 @@ namespace Sass {
11831180
11841181 bool SassArgumentList::operator ==(const Value& rhs) const
11851182 {
1186- if (const SassList * r = Cast<SassList>(& rhs)) {
1183+ if (const SassList * r = rhs. isList ( )) {
11871184 return SassList::operator ==(*r);
11881185 }
1189- if (const Map * r = Cast<Map>(& rhs)) {
1186+ if (const Map * r = rhs. isMap ( )) {
11901187 return SassList::operator ==(*r);
11911188 }
11921189 return false ;
@@ -1202,7 +1199,7 @@ namespace Sass {
12021199
12031200 bool SassFunction::operator == (const Value& rhs) const
12041201 {
1205- if (const SassFunction* fn = Cast<SassFunction>(& rhs)) {
1202+ if (const SassFunction* fn = rhs. isFunction ( )) {
12061203 return ObjEqualityFn (callable_, fn->callable ());
12071204 }
12081205 return false ;
0 commit comments