Skip to content

Commit

Permalink
Merge pull request #2091 from xzyfer/feat/remove-cssize-selector
Browse files Browse the repository at this point in the history
Remove the selector stack from the cssize visitor
  • Loading branch information
xzyfer committed May 22, 2016
2 parents 7165dc7 + d71883a commit 2b2f484
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
12 changes: 1 addition & 11 deletions src/cssize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,14 @@ namespace Sass {
: ctx(ctx),
block_stack(std::vector<Block*>()),
p_stack(std::vector<Statement*>()),
s_stack(std::vector<Selector_List*>()),
backtrace(bt)
{
s_stack.push_back(NULL);
}
{ }

Statement* Cssize::parent()
{
return p_stack.size() ? p_stack.back() : block_stack.front();
}

Selector_List* Cssize::selector()
{
return s_stack.size() ? s_stack.back() : NULL;
}

Statement* Cssize::operator()(Block* b)
{
Block* bb = SASS_MEMORY_NEW(ctx.mem, Block, b->pstate(), b->length(), b->is_root());
Expand Down Expand Up @@ -145,7 +137,6 @@ namespace Sass {
Statement* Cssize::operator()(Ruleset* r)
{
p_stack.push_back(r);
s_stack.push_back(dynamic_cast<Selector_List*>(r->selector()));
// this can return a string schema
// string schema is not a statement!
// r->block() is already a string schema
Expand All @@ -162,7 +153,6 @@ namespace Sass {
stmt->block());
rr->is_root(r->is_root());
// rr->tabs(r->block()->tabs());
s_stack.pop_back();
p_stack.pop_back();

if (!rr->block()) {
Expand Down
1 change: 0 additions & 1 deletion src/cssize.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ namespace Sass {
Context& ctx;
std::vector<Block*> block_stack;
std::vector<Statement*> p_stack;
std::vector<Selector_List*> s_stack;
Backtrace* backtrace;

Statement* fallback_impl(AST_Node* n);
Expand Down

0 comments on commit 2b2f484

Please # to comment.