Skip to content

Commit b977967

Browse files
committed
Rename Type_Selector to TypeSelector
1 parent 085aed1 commit b977967

13 files changed

+34
-34
lines changed

src/ast_fwd_decl.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ namespace Sass {
101101

102102
class Selector_Schema;
103103
class Placeholder_Selector;
104-
class Type_Selector;
104+
class TypeSelector;
105105
class Class_Selector;
106106
class IDSelector;
107107
class Attribute_Selector;
@@ -198,7 +198,7 @@ namespace Sass {
198198
IMPL_MEM_OBJ(Selector_Schema);
199199
IMPL_MEM_OBJ(SimpleSelector);
200200
IMPL_MEM_OBJ(Placeholder_Selector);
201-
IMPL_MEM_OBJ(Type_Selector);
201+
IMPL_MEM_OBJ(TypeSelector);
202202
IMPL_MEM_OBJ(Class_Selector);
203203
IMPL_MEM_OBJ(IDSelector);
204204
IMPL_MEM_OBJ(Attribute_Selector);

src/ast_sel_cmp.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,9 @@ namespace Sass {
305305
return sel ? *this == *sel : false;
306306
}
307307

308-
bool Type_Selector::operator== (const SimpleSelector& rhs) const
308+
bool TypeSelector::operator== (const SimpleSelector& rhs) const
309309
{
310-
auto sel = Cast<Type_Selector>(&rhs);
310+
auto sel = Cast<TypeSelector>(&rhs);
311311
return sel ? *this == *sel : false;
312312
}
313313

@@ -344,7 +344,7 @@ namespace Sass {
344344
return name() == rhs.name();
345345
}
346346

347-
bool Type_Selector::operator== (const Type_Selector& rhs) const
347+
bool TypeSelector::operator== (const TypeSelector& rhs) const
348348
{
349349
return is_ns_eq(rhs) && name() == rhs.name();
350350
}

src/ast_sel_super.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,11 @@ namespace Sass {
109109
// ##########################################################################
110110
// ##########################################################################
111111
bool typeIsSuperselectorOfCompound(
112-
const Type_Selector_Obj& type,
112+
const TypeSelectorObj& type,
113113
const CompoundSelectorObj& compound)
114114
{
115115
for (const SimpleSelectorObj& simple : compound->elements()) {
116-
if (const Type_Selector_Obj& rhs = Cast<Type_Selector>(simple)) {
116+
if (const TypeSelectorObj& rhs = Cast<TypeSelector>(simple)) {
117117
if (*type != *rhs) return true;
118118
}
119119
}
@@ -161,7 +161,7 @@ namespace Sass {
161161
const ComplexSelectorObj& parent)
162162
{
163163
for (const SimpleSelectorObj& simple2 : compound2->elements()) {
164-
if (const Type_Selector_Obj& type2 = Cast<Type_Selector>(simple2)) {
164+
if (const TypeSelectorObj& type2 = Cast<TypeSelector>(simple2)) {
165165
if (const CompoundSelectorObj& compound1 = Cast<CompoundSelector>(parent->last())) {
166166
if (typeIsSuperselectorOfCompound(type2, compound1)) return true;
167167
}

src/ast_sel_unify.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,13 @@ namespace Sass {
120120
// ##########################################################################
121121
// This is implemented in `selector/type.dart` as `PseudoSelector::unify`
122122
// ##########################################################################
123-
CompoundSelector* Type_Selector::unifyWith(CompoundSelector* rhs)
123+
CompoundSelector* TypeSelector::unifyWith(CompoundSelector* rhs)
124124
{
125125
if (rhs->empty()) {
126126
rhs->append(this);
127127
return rhs;
128128
}
129-
Type_Selector* type = Cast<Type_Selector>(rhs->at(0));
129+
TypeSelector* type = Cast<TypeSelector>(rhs->at(0));
130130
if (type != nullptr) {
131131
SimpleSelector* unified = unifyWith(type);
132132
if (unified == nullptr) {
@@ -206,7 +206,7 @@ namespace Sass {
206206
// or [TypeSelector]s. If no such selector can be produced, returns `null`.
207207
// Note: libsass handles universal selector directly within the type selector
208208
// ##########################################################################
209-
SimpleSelector* Type_Selector::unifyWith(const SimpleSelector* rhs)
209+
SimpleSelector* TypeSelector::unifyWith(const SimpleSelector* rhs)
210210
{
211211
bool rhs_ns = false;
212212
if (!(is_ns_eq(*rhs) || rhs->is_universal_ns())) {
@@ -229,7 +229,7 @@ namespace Sass {
229229
if (rhs_name) name(rhs->name());
230230
return this;
231231
}
232-
// EO Type_Selector::unifyWith(const SimpleSelector*)
232+
// EO TypeSelector::unifyWith(const SimpleSelector*)
233233

234234
// ##########################################################################
235235
// Unify two complex selectors. Internally calls `unifyComplex`

src/ast_selectors.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,14 +191,14 @@ namespace Sass {
191191
/////////////////////////////////////////////////////////////////////////
192192
/////////////////////////////////////////////////////////////////////////
193193

194-
Type_Selector::Type_Selector(ParserState pstate, sass::string n)
194+
TypeSelector::TypeSelector(ParserState pstate, sass::string n)
195195
: SimpleSelector(pstate, n)
196196
{ simple_type(TYPE_SEL); }
197-
Type_Selector::Type_Selector(const Type_Selector* ptr)
197+
TypeSelector::TypeSelector(const TypeSelector* ptr)
198198
: SimpleSelector(ptr)
199199
{ simple_type(TYPE_SEL); }
200200

201-
unsigned long Type_Selector::specificity() const
201+
unsigned long TypeSelector::specificity() const
202202
{
203203
if (name() == "*") return 0;
204204
else return Constants::Specificity_Element;
@@ -549,7 +549,7 @@ namespace Sass {
549549
{
550550
if (hasRealParent()) return true;
551551
// ToDo: dart sass has another check?
552-
// if (Cast<Type_Selector>(front)) {
552+
// if (Cast<TypeSelector>(front)) {
553553
// if (front->ns() != "") return false;
554554
// }
555555
for (const SimpleSelector* s : elements()) {
@@ -887,7 +887,7 @@ namespace Sass {
887887
SimpleSelectorObj back = tail->last();
888888
SimpleSelectorObj front = first();
889889
auto simple_back = Cast<SimpleSelector>(back);
890-
auto simple_front = Cast<Type_Selector>(front);
890+
auto simple_front = Cast<TypeSelector>(front);
891891
if (simple_front && simple_back) {
892892
simple_back = SASS_MEMORY_COPY(simple_back);
893893
auto name = simple_back->name();
@@ -1021,7 +1021,7 @@ namespace Sass {
10211021
IMPLEMENT_AST_OPERATORS(Selector_Schema);
10221022
IMPLEMENT_AST_OPERATORS(Placeholder_Selector);
10231023
IMPLEMENT_AST_OPERATORS(Attribute_Selector);
1024-
IMPLEMENT_AST_OPERATORS(Type_Selector);
1024+
IMPLEMENT_AST_OPERATORS(TypeSelector);
10251025
IMPLEMENT_AST_OPERATORS(Class_Selector);
10261026
IMPLEMENT_AST_OPERATORS(IDSelector);
10271027
IMPLEMENT_AST_OPERATORS(Pseudo_Selector);

src/ast_selectors.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ namespace Sass {
118118

119119
/* helper function for syntax sugar */
120120
virtual IDSelector* getIdSelector() { return NULL; }
121-
virtual Type_Selector* getTypeSelector() { return NULL; }
121+
virtual TypeSelector* getTypeSelector() { return NULL; }
122122
virtual Pseudo_Selector* getPseudoSelector() { return NULL; }
123123

124124
ComplexSelectorObj wrapInComplex();
@@ -159,16 +159,16 @@ namespace Sass {
159159
/////////////////////////////////////////////////////////////////////
160160
// Type selectors (and the universal selector) -- e.g., div, span, *.
161161
/////////////////////////////////////////////////////////////////////
162-
class Type_Selector final : public SimpleSelector {
162+
class TypeSelector final : public SimpleSelector {
163163
public:
164-
Type_Selector(ParserState pstate, sass::string n);
164+
TypeSelector(ParserState pstate, sass::string n);
165165
virtual unsigned long specificity() const override;
166166
SimpleSelector* unifyWith(const SimpleSelector*);
167167
CompoundSelector* unifyWith(CompoundSelector*) override;
168-
Type_Selector* getTypeSelector() override { return this; }
168+
TypeSelector* getTypeSelector() override { return this; }
169169
bool operator==(const SimpleSelector& rhs) const final override;
170-
ATTACH_CMP_OPERATIONS(Type_Selector)
171-
ATTACH_AST_OPERATIONS(Type_Selector)
170+
ATTACH_CMP_OPERATIONS(TypeSelector)
171+
ATTACH_AST_OPERATIONS(TypeSelector)
172172
ATTACH_CRTP_PERFORM_METHODS()
173173
};
174174

src/debugger.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -454,9 +454,9 @@ inline void debug_ast(AST_Node* node, sass::string ind, Env* env)
454454
std::cerr << " <" << selector->hash() << ">";
455455
std::cerr << " <<" << selector->ns_name() << ">>";
456456
std::cerr << std::endl;
457-
} else if (Cast<Type_Selector>(node)) {
458-
Type_Selector* selector = Cast<Type_Selector>(node);
459-
std::cerr << ind << "Type_Selector " << selector;
457+
} else if (Cast<TypeSelector>(node)) {
458+
TypeSelector* selector = Cast<TypeSelector>(node);
459+
std::cerr << ind << "TypeSelector " << selector;
460460
std::cerr << " (" << pstate_source_position(node) << ")";
461461
std::cerr << " <" << selector->hash() << ">";
462462
std::cerr << " <<" << selector->ns_name() << ">>";

src/eval.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ namespace Sass {
8787
// they don't have any specific implementation (yet)
8888
IDSelector* operator()(IDSelector* s) { return s; };
8989
Class_Selector* operator()(Class_Selector* s) { return s; };
90-
Type_Selector* operator()(Type_Selector* s) { return s; };
90+
TypeSelector* operator()(TypeSelector* s) { return s; };
9191
Attribute_Selector* operator()(Attribute_Selector* s) { return s; };
9292
Placeholder_Selector* operator()(Placeholder_Selector* s) { return s; };
9393

src/inspect.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,7 @@ namespace Sass {
940940

941941
}
942942

943-
void Inspect::operator()(Type_Selector* s)
943+
void Inspect::operator()(TypeSelector* s)
944944
{
945945
append_token(s->ns_name(), s);
946946
}

src/inspect.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ namespace Sass {
8282
// selectors
8383
virtual void operator()(Selector_Schema*);
8484
virtual void operator()(Placeholder_Selector*);
85-
virtual void operator()(Type_Selector*);
85+
virtual void operator()(TypeSelector*);
8686
virtual void operator()(Class_Selector*);
8787
virtual void operator()(IDSelector*);
8888
virtual void operator()(Attribute_Selector*);

0 commit comments

Comments
 (0)