Skip to content

Commit 2ba1263

Browse files
committed
Rename the Selector_Placeholder AST node to Placeholder_Selector
This better matches the Ruby Sass implementation.
1 parent c49c339 commit 2ba1263

File tree

9 files changed

+20
-20
lines changed

9 files changed

+20
-20
lines changed

src/ast.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,8 +1047,8 @@ namespace Sass {
10471047
tss->name(tss->name() + (*h)[0]->name());
10481048
(*rh)[rh->length()-1] = tss;
10491049
for (i = 1; i < L; ++i) *rh << (*h)[i];
1050-
} else if (Selector_Placeholder* ps = dynamic_cast<Selector_Placeholder*>(rh->last())) {
1051-
Selector_Placeholder* pss = new Selector_Placeholder(*ps);
1050+
} else if (Placeholder_Selector* ps = dynamic_cast<Placeholder_Selector*>(rh->last())) {
1051+
Placeholder_Selector* pss = new Placeholder_Selector(*ps);
10521052
pss->name(pss->name() + (*h)[0]->name());
10531053
(*rh)[rh->length()-1] = pss;
10541054
for (i = 1; i < L; ++i) *rh << (*h)[i];
@@ -1351,7 +1351,7 @@ namespace Sass {
13511351
}
13521352

13531353
/* not used anymore - remove?
1354-
Selector_Placeholder* Selector::find_placeholder()
1354+
Placeholder_Selector* Selector::find_placeholder()
13551355
{
13561356
return 0;
13571357
}*/

src/ast.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2033,17 +2033,17 @@ namespace Sass {
20332033
/////////////////////////////////////////////////////////////////////////
20342034
// Placeholder selectors (e.g., "%foo") for use in extend-only selectors.
20352035
/////////////////////////////////////////////////////////////////////////
2036-
class Selector_Placeholder : public Simple_Selector {
2036+
class Placeholder_Selector : public Simple_Selector {
20372037
public:
2038-
Selector_Placeholder(ParserState pstate, std::string n)
2038+
Placeholder_Selector(ParserState pstate, std::string n)
20392039
: Simple_Selector(pstate, n)
20402040
{ has_placeholder(true); }
20412041
virtual unsigned long specificity()
20422042
{
20432043
return Constants::Specificity_Base;
20442044
}
2045-
// virtual Selector_Placeholder* find_placeholder();
2046-
virtual ~Selector_Placeholder() {};
2045+
// virtual Placeholder_Selector* find_placeholder();
2046+
virtual ~Placeholder_Selector() {};
20472047
ATTACH_OPERATIONS()
20482048
};
20492049

@@ -2265,7 +2265,7 @@ namespace Sass {
22652265

22662266
Complex_Selector* to_complex(Memory_Manager& mem);
22672267
Compound_Selector* unify_with(Compound_Selector* rhs, Context& ctx);
2268-
// virtual Selector_Placeholder* find_placeholder();
2268+
// virtual Placeholder_Selector* find_placeholder();
22692269
virtual bool has_parent_ref();
22702270
Simple_Selector* base()
22712271
{
@@ -2408,7 +2408,7 @@ namespace Sass {
24082408
virtual bool is_superselector_of(Compound_Selector* sub, std::string wrapping = "");
24092409
virtual bool is_superselector_of(Complex_Selector* sub, std::string wrapping = "");
24102410
virtual bool is_superselector_of(Selector_List* sub, std::string wrapping = "");
2411-
// virtual Selector_Placeholder* find_placeholder();
2411+
// virtual Placeholder_Selector* find_placeholder();
24122412
Selector_List* unify_with(Complex_Selector* rhs, Context& ctx);
24132413
Combinator clear_innermost();
24142414
void append(Context&, Complex_Selector*);
@@ -2516,7 +2516,7 @@ namespace Sass {
25162516
// basically unwraps parsed selectors
25172517
virtual bool has_parent_ref();
25182518
void remove_parent_selectors();
2519-
// virtual Selector_Placeholder* find_placeholder();
2519+
// virtual Placeholder_Selector* find_placeholder();
25202520
Selector_List* resolve_parent_refs(Context& ctx, Selector_List* parents, bool implicit_parent = true);
25212521
virtual bool is_superselector_of(Compound_Selector* sub, std::string wrapping = "");
25222522
virtual bool is_superselector_of(Complex_Selector* sub, std::string wrapping = "");

src/ast_fwd_decl.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ namespace Sass {
7373
// selectors
7474
class Selector;
7575
class Selector_Schema;
76-
class Selector_Placeholder;
76+
class Placeholder_Selector;
7777
class Element_Selector;
7878
class Selector_Qualifier;
7979
class Attribute_Selector;

src/debugger.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,10 @@ inline void debug_ast(AST_Node* node, std::string ind, Env* env)
211211
std::cerr << (selector->has_line_feed() ? " [line-feed]": " -");
212212
std::cerr << " <" << prettyprint(selector->pstate().token.ws_before()) << ">";
213213
std::cerr << std::endl;
214-
} else if (dynamic_cast<Selector_Placeholder*>(node)) {
214+
} else if (dynamic_cast<Placeholder_Selector*>(node)) {
215215

216-
Selector_Placeholder* selector = dynamic_cast<Selector_Placeholder*>(node);
217-
std::cerr << ind << "Selector_Placeholder [" << selector->ns_name() << "] " << selector
216+
Placeholder_Selector* selector = dynamic_cast<Placeholder_Selector*>(node);
217+
std::cerr << ind << "Placeholder_Selector [" << selector->ns_name() << "] " << selector
218218
<< " <" << selector->hash() << ">"
219219
<< " [@media:" << selector->media_block() << "]"
220220
<< (selector->is_optional() ? " [is_optional]": " -")

src/eval.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ namespace Sass {
7878
Pseudo_Selector* operator()(Pseudo_Selector* s) { return s; };
7979
Wrapped_Selector* operator()(Wrapped_Selector* s) { return s; };
8080
Selector_Qualifier* operator()(Selector_Qualifier* s) { return s; };
81-
Selector_Placeholder* operator()(Selector_Placeholder* s) { return s; };
81+
Placeholder_Selector* operator()(Placeholder_Selector* s) { return s; };
8282
// actual evaluated selectors
8383
Selector_List* operator()(Selector_Schema*);
8484
Expression* operator()(Parent_Selector*);

src/inspect.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,7 @@ namespace Sass {
879879
append_string("&");
880880
}
881881

882-
void Inspect::operator()(Selector_Placeholder* s)
882+
void Inspect::operator()(Placeholder_Selector* s)
883883
{
884884
append_token(s->name(), s);
885885
if (s->has_line_break()) append_optional_linefeed();

src/inspect.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ namespace Sass {
8181
virtual void operator()(Arguments*);
8282
// selectors
8383
virtual void operator()(Selector_Schema*);
84-
virtual void operator()(Selector_Placeholder*);
84+
virtual void operator()(Placeholder_Selector*);
8585
virtual void operator()(Element_Selector*);
8686
virtual void operator()(Selector_Qualifier*);
8787
virtual void operator()(Attribute_Selector*);

src/operation.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ namespace Sass {
7171
virtual T operator()(Arguments* x) = 0;
7272
// selectors
7373
virtual T operator()(Selector_Schema* x) = 0;
74-
virtual T operator()(Selector_Placeholder* x) = 0;
74+
virtual T operator()(Placeholder_Selector* x) = 0;
7575
virtual T operator()(Element_Selector* x) = 0;
7676
virtual T operator()(Selector_Qualifier* x) = 0;
7777
virtual T operator()(Attribute_Selector* x) = 0;
@@ -152,7 +152,7 @@ namespace Sass {
152152
T operator()(Arguments* x) { return static_cast<D*>(this)->fallback(x); }
153153
// selectors
154154
T operator()(Selector_Schema* x) { return static_cast<D*>(this)->fallback(x); }
155-
T operator()(Selector_Placeholder* x) { return static_cast<D*>(this)->fallback(x); }
155+
T operator()(Placeholder_Selector* x) { return static_cast<D*>(this)->fallback(x); }
156156
T operator()(Element_Selector* x) { return static_cast<D*>(this)->fallback(x); }
157157
T operator()(Selector_Qualifier* x) { return static_cast<D*>(this)->fallback(x); }
158158
T operator()(Attribute_Selector* x) { return static_cast<D*>(this)->fallback(x); }

src/parser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,7 @@ namespace Sass {
821821
return parse_attribute_selector();
822822
}
823823
else if (lex< placeholder >()) {
824-
Selector_Placeholder* sel = SASS_MEMORY_NEW(ctx.mem, Selector_Placeholder, pstate, lexed);
824+
Placeholder_Selector* sel = SASS_MEMORY_NEW(ctx.mem, Placeholder_Selector, pstate, lexed);
825825
sel->media_block(last_media_block);
826826
return sel;
827827
}

0 commit comments

Comments
 (0)