Skip to content

Commit

Permalink
Implement top comments (before first import)
Browse files Browse the repository at this point in the history
Fixes #469
  • Loading branch information
mgreter committed Jan 5, 2015
1 parent d47c963 commit afe8248
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions output_nested.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,19 @@ namespace Sass {
}
}

void Output_Nested::operator()(Comment* c)
{
To_String to_string;
string txt = c->text()->perform(&to_string);
if (buffer.size() + top_imports.size() == 0) {
top_comments.push_back(c);
} else {
Inspect i(ctx);
c->perform(&i);
append_to_buffer(i.get_buffer());
}
}

void Output_Nested::operator()(Ruleset* r)
{
Selector* s = r->selector();
Expand Down
2 changes: 1 addition & 1 deletion output_nested.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace Sass {
// virtual void operator()(Warning*);
// virtual void operator()(Error*);
// virtual void operator()(Debug*);
// virtual void operator()(Comment*);
virtual void operator()(Comment*);
// virtual void operator()(If*);
// virtual void operator()(For*);
// virtual void operator()(Each*);
Expand Down

0 comments on commit afe8248

Please sign in to comment.