Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Remove the selector stack from the cssize visitor #2091

Merged
merged 1 commit into from
May 22, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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