Skip to content

Commit 2f06900

Browse files
committed
Handle only the required nodes in Listize
1 parent 3681c48 commit 2f06900

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
@@ -316,7 +316,7 @@ namespace Sass {
316316
register_c_function(*this, &tge, c_functions[i]);
317317
}
318318
Contextualize contextualize(*this, &tge, &backtrace);
319-
Listize listize(*this, &tge, &backtrace);
319+
Listize listize(*this);
320320
Eval eval(*this, &contextualize, &listize, &tge, &backtrace);
321321
Contextualize_Eval contextualize_eval(*this, &eval, &tge, &backtrace);
322322
Expand expand(*this, &eval, &contextualize_eval, &tge, &backtrace);

functions.cpp

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

@@ -1488,7 +1488,7 @@ namespace Sass {
14881488
BUILT_IN(sass_if)
14891489
{
14901490
Contextualize contextualize(ctx, &d_env, backtrace);
1491-
Listize listize(ctx, &d_env, backtrace);
1491+
Listize listize(ctx);
14921492
Eval eval(ctx, &contextualize, &listize, &d_env, backtrace);
14931493
bool is_true = !ARG("$condition", Expression)->perform(&eval)->is_false();
14941494
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)