Skip to content

Commit 4c2a62a

Browse files
committed
Merge pull request #975 from xzyfer/clean/ampersand-in-sassscript
Handle only the required nodes in Listize
2 parents efeace5 + 2f06900 commit 4c2a62a

File tree

4 files changed

+7
-23
lines changed

4 files changed

+7
-23
lines changed

context.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ namespace Sass {
334334
register_c_function(*this, &tge, c_functions[i]);
335335
}
336336
Contextualize contextualize(*this, &tge, &backtrace);
337-
Listize listize(*this, &tge, &backtrace);
337+
Listize listize(*this);
338338
Eval eval(*this, &contextualize, &listize, &tge, &backtrace);
339339
Contextualize_Eval contextualize_eval(*this, &eval, &tge, &backtrace);
340340
Expand expand(*this, &eval, &contextualize_eval, &tge, &backtrace);

functions.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1472,7 +1472,7 @@ namespace Sass {
14721472
}
14731473
Function_Call* func = new (ctx.mem) Function_Call(pstate, name, args);
14741474
Contextualize contextualize(ctx, &d_env, backtrace);
1475-
Listize listize(ctx, &d_env, backtrace);
1475+
Listize listize(ctx);
14761476
Eval eval(ctx, &contextualize, &listize, &d_env, backtrace);
14771477
return func->perform(&eval);
14781478

@@ -1492,7 +1492,7 @@ namespace Sass {
14921492
BUILT_IN(sass_if)
14931493
{
14941494
Contextualize contextualize(ctx, &d_env, backtrace);
1495-
Listize listize(ctx, &d_env, backtrace);
1495+
Listize listize(ctx);
14961496
Eval eval(ctx, &contextualize, &listize, &d_env, backtrace);
14971497
bool is_true = !ARG("$condition", Expression)->perform(&eval)->is_false();
14981498
if (is_true) {

listize.cpp

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@
99

1010
namespace Sass {
1111

12-
Listize::Listize(Context& ctx, Env* env, Backtrace* bt)
13-
: ctx(ctx),
14-
env(env),
15-
backtrace(bt)
12+
Listize::Listize(Context& ctx)
13+
: ctx(ctx)
1614
{ }
1715

1816
Expression* Listize::operator()(Selector_List* sel)
@@ -35,16 +33,6 @@ namespace Sass {
3533
return new (ctx.mem) String_Constant(sel->pstate(), str);
3634
}
3735

38-
Expression* Listize::operator()(Type_Selector* sel)
39-
{
40-
return new (ctx.mem) String_Constant(sel->pstate(), sel->name());
41-
}
42-
43-
Expression* Listize::operator()(Selector_Qualifier* sel)
44-
{
45-
return new (ctx.mem) String_Constant(sel->pstate(), sel->name());
46-
}
47-
4836
Expression* Listize::operator()(Complex_Selector* sel)
4937
{
5038
List* l = new (ctx.mem) List(sel->pstate(), 2);
@@ -90,6 +78,6 @@ namespace Sass {
9078

9179
Expression* Listize::fallback_impl(AST_Node* n)
9280
{
93-
return 0;
81+
return static_cast<Expression*>(n);
9482
}
9583
}

listize.hpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,18 @@ namespace Sass {
1818
class Listize : public Operation_CRTP<Expression*, Listize> {
1919

2020
Context& ctx;
21-
Env* env;
22-
Backtrace* backtrace;
2321

2422
Expression* fallback_impl(AST_Node* n);
2523

2624
public:
27-
Listize(Context&, Env*, Backtrace*);
25+
Listize(Context&);
2826
virtual ~Listize() { }
2927

3028
using Operation<Expression*>::operator();
3129

3230
Expression* operator()(Selector_List*);
3331
Expression* operator()(Complex_Selector*);
3432
Expression* operator()(Compound_Selector*);
35-
Expression* operator()(Type_Selector*);
36-
Expression* operator()(Selector_Qualifier*);
3733
Expression* operator()(Selector_Reference*);
3834

3935
template <typename U>

0 commit comments

Comments
 (0)