Skip to content

Commit 085aed1

Browse files
committed
Rename Id_Selector to IDSelector
1 parent 0aff8d5 commit 085aed1

13 files changed

+30
-30
lines changed

src/ast_fwd_decl.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ namespace Sass {
103103
class Placeholder_Selector;
104104
class Type_Selector;
105105
class Class_Selector;
106-
class Id_Selector;
106+
class IDSelector;
107107
class Attribute_Selector;
108108

109109
class Pseudo_Selector;
@@ -200,7 +200,7 @@ namespace Sass {
200200
IMPL_MEM_OBJ(Placeholder_Selector);
201201
IMPL_MEM_OBJ(Type_Selector);
202202
IMPL_MEM_OBJ(Class_Selector);
203-
IMPL_MEM_OBJ(Id_Selector);
203+
IMPL_MEM_OBJ(IDSelector);
204204
IMPL_MEM_OBJ(Attribute_Selector);
205205
IMPL_MEM_OBJ(Pseudo_Selector);
206206

src/ast_sel_cmp.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,9 +299,9 @@ namespace Sass {
299299
/*#########################################################################*/
300300
/*#########################################################################*/
301301

302-
bool Id_Selector::operator== (const SimpleSelector& rhs) const
302+
bool IDSelector::operator== (const SimpleSelector& rhs) const
303303
{
304-
auto sel = Cast<Id_Selector>(&rhs);
304+
auto sel = Cast<IDSelector>(&rhs);
305305
return sel ? *this == *sel : false;
306306
}
307307

@@ -338,7 +338,7 @@ namespace Sass {
338338
/*#########################################################################*/
339339
/*#########################################################################*/
340340

341-
bool Id_Selector::operator== (const Id_Selector& rhs) const
341+
bool IDSelector::operator== (const IDSelector& rhs) const
342342
{
343343
// ID has no namespacing
344344
return name() == rhs.name();

src/ast_sel_super.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,11 @@ namespace Sass {
124124
// ##########################################################################
125125
// ##########################################################################
126126
bool idIsSuperselectorOfCompound(
127-
const Id_Selector_Obj& id,
127+
const IDSelectorObj& id,
128128
const CompoundSelectorObj& compound)
129129
{
130130
for (const SimpleSelectorObj& simple : compound->elements()) {
131-
if (const Id_Selector_Obj& rhs = Cast<Id_Selector>(simple)) {
131+
if (const IDSelectorObj& rhs = Cast<IDSelector>(simple)) {
132132
if (*id != *rhs) return true;
133133
}
134134
}
@@ -166,7 +166,7 @@ namespace Sass {
166166
if (typeIsSuperselectorOfCompound(type2, compound1)) return true;
167167
}
168168
}
169-
else if (const Id_Selector_Obj& id2 = Cast<Id_Selector>(simple2)) {
169+
else if (const IDSelectorObj& id2 = Cast<IDSelector>(simple2)) {
170170
if (const CompoundSelectorObj& compound1 = Cast<CompoundSelector>(parent->last())) {
171171
if (idIsSuperselectorOfCompound(id2, compound1)) return true;
172172
}

src/ast_sel_unify.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,10 @@ namespace Sass {
143143
// ##########################################################################
144144
// This is implemented in `selector/id.dart` as `PseudoSelector::unify`
145145
// ##########################################################################
146-
CompoundSelector* Id_Selector::unifyWith(CompoundSelector* rhs)
146+
CompoundSelector* IDSelector::unifyWith(CompoundSelector* rhs)
147147
{
148148
for (const SimpleSelector* sel : rhs->elements()) {
149-
if (const Id_Selector* id_sel = Cast<Id_Selector>(sel)) {
149+
if (const IDSelector* id_sel = Cast<IDSelector>(sel)) {
150150
if (id_sel->name() != name()) return nullptr;
151151
}
152152
}

src/ast_sel_weave.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace Sass {
2424
// ##########################################################################
2525
bool isUnique(const SimpleSelector* simple)
2626
{
27-
if (Cast<Id_Selector>(simple)) return true;
27+
if (Cast<IDSelector>(simple)) return true;
2828
if (const Pseudo_Selector * pseudo = Cast<Pseudo_Selector>(simple)) {
2929
if (pseudo->is_pseudo_element()) return true;
3030
}

src/ast_selectors.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,14 +222,14 @@ namespace Sass {
222222
/////////////////////////////////////////////////////////////////////////
223223
/////////////////////////////////////////////////////////////////////////
224224

225-
Id_Selector::Id_Selector(ParserState pstate, sass::string n)
225+
IDSelector::IDSelector(ParserState pstate, sass::string n)
226226
: SimpleSelector(pstate, n)
227227
{ simple_type(ID_SEL); }
228-
Id_Selector::Id_Selector(const Id_Selector* ptr)
228+
IDSelector::IDSelector(const IDSelector* ptr)
229229
: SimpleSelector(ptr)
230230
{ simple_type(ID_SEL); }
231231

232-
unsigned long Id_Selector::specificity() const
232+
unsigned long IDSelector::specificity() const
233233
{
234234
return Constants::Specificity_ID;
235235
}
@@ -1023,7 +1023,7 @@ namespace Sass {
10231023
IMPLEMENT_AST_OPERATORS(Attribute_Selector);
10241024
IMPLEMENT_AST_OPERATORS(Type_Selector);
10251025
IMPLEMENT_AST_OPERATORS(Class_Selector);
1026-
IMPLEMENT_AST_OPERATORS(Id_Selector);
1026+
IMPLEMENT_AST_OPERATORS(IDSelector);
10271027
IMPLEMENT_AST_OPERATORS(Pseudo_Selector);
10281028
IMPLEMENT_AST_OPERATORS(SelectorCombinator);
10291029
IMPLEMENT_AST_OPERATORS(CompoundSelector);

src/ast_selectors.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ namespace Sass {
117117
virtual CompoundSelector* unifyWith(CompoundSelector*);
118118

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

@@ -188,15 +188,15 @@ namespace Sass {
188188
////////////////////////////////////////////////
189189
// ID selectors -- i.e., #foo.
190190
////////////////////////////////////////////////
191-
class Id_Selector final : public SimpleSelector {
191+
class IDSelector final : public SimpleSelector {
192192
public:
193-
Id_Selector(ParserState pstate, sass::string n);
193+
IDSelector(ParserState pstate, sass::string n);
194194
virtual unsigned long specificity() const override;
195195
CompoundSelector* unifyWith(CompoundSelector*) override;
196-
Id_Selector* getIdSelector() final override { return this; }
196+
IDSelector* getIdSelector() final override { return this; }
197197
bool operator==(const SimpleSelector& rhs) const final override;
198-
ATTACH_CMP_OPERATIONS(Id_Selector)
199-
ATTACH_AST_OPERATIONS(Id_Selector)
198+
ATTACH_CMP_OPERATIONS(IDSelector)
199+
ATTACH_AST_OPERATIONS(IDSelector)
200200
ATTACH_CRTP_PERFORM_METHODS()
201201
};
202202

src/debugger.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -447,9 +447,9 @@ inline void debug_ast(AST_Node* node, sass::string ind, Env* env)
447447
std::cerr << " <" << selector->hash() << ">";
448448
std::cerr << " <<" << selector->ns_name() << ">>";
449449
std::cerr << std::endl;
450-
} else if (Cast<Id_Selector>(node)) {
451-
Id_Selector* selector = Cast<Id_Selector>(node);
452-
std::cerr << ind << "Id_Selector " << selector;
450+
} else if (Cast<IDSelector>(node)) {
451+
IDSelector* selector = Cast<IDSelector>(node);
452+
std::cerr << ind << "IDSelector " << selector;
453453
std::cerr << " (" << pstate_source_position(node) << ")";
454454
std::cerr << " <" << selector->hash() << ">";
455455
std::cerr << " <<" << selector->ns_name() << ">>";

src/eval.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ namespace Sass {
8585
Pseudo_Selector* operator()(Pseudo_Selector* s);
8686

8787
// they don't have any specific implementation (yet)
88-
Id_Selector* operator()(Id_Selector* s) { return s; };
88+
IDSelector* operator()(IDSelector* s) { return s; };
8989
Class_Selector* operator()(Class_Selector* s) { return s; };
9090
Type_Selector* operator()(Type_Selector* s) { return s; };
9191
Attribute_Selector* operator()(Attribute_Selector* s) { return s; };

src/inspect.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,7 @@ namespace Sass {
950950
append_token(s->ns_name(), s);
951951
}
952952

953-
void Inspect::operator()(Id_Selector* s)
953+
void Inspect::operator()(IDSelector* s)
954954
{
955955
append_token(s->ns_name(), s);
956956
}

0 commit comments

Comments
 (0)