Skip to content

Commit

Permalink
Remove obsolete in_selector flag
Browse files Browse the repository at this point in the history
  • Loading branch information
mgreter committed Mar 17, 2018
1 parent 205dc65 commit 4c34d16
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 16 deletions.
2 changes: 0 additions & 2 deletions src/eval.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1534,10 +1534,8 @@ namespace Sass {
{
LOCAL_FLAG(is_in_selector_schema, true);
// the parser will look for a brace to end the selector
ctx.c_options.in_selector = true; // do not compress colors
Expression_Obj sel = s->contents()->perform(this);
std::string result_str(sel->to_string(ctx.c_options));
ctx.c_options.in_selector = false; // flag temporary only
result_str = unquote(Util::rtrim(result_str));
char* temp_cstr = sass_copy_c_string(result_str.c_str());
ctx.strings.push_back(temp_cstr); // attach to context
Expand Down
9 changes: 0 additions & 9 deletions src/inspect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ namespace Sass {
void Inspect::operator()(Ruleset_Ptr ruleset)
{
if (ruleset->selector()) {
opt.in_selector = true;
ruleset->selector()->perform(this);
opt.in_selector = false;
}
if (ruleset->block()) {
ruleset->block()->perform(this);
Expand Down Expand Up @@ -623,11 +621,6 @@ namespace Sass {
// maybe an unknown token
std::string name = c->disp();

if (opt.in_selector && name != "") {
append_token(name, c);
return;
}

// resolved color
std::string res_name = name;

Expand Down Expand Up @@ -915,9 +908,7 @@ namespace Sass {

void Inspect::operator()(Selector_Schema_Ptr s)
{
opt.in_selector = true;
s->contents()->perform(this);
opt.in_selector = false;
}

void Inspect::operator()(Parent_Selector_Ptr p)
Expand Down
7 changes: 2 additions & 5 deletions src/sass.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,10 @@ struct Sass_Inspect_Options {
// Precision for fractional numbers
int precision;

// Do not compress colors in selectors
bool in_selector;

// initialization list (constructor with defaults)
Sass_Inspect_Options(Sass_Output_Style style = Sass::NESTED,
int precision = 5, bool in_selector = false)
: output_style(style), precision(precision), in_selector(in_selector)
int precision = 5)
: output_style(style), precision(precision)
{ }

};
Expand Down

0 comments on commit 4c34d16

Please sign in to comment.