Skip to content

Commit 4b689ac

Browse files
committed
Merge pull request #1003 from mgreter/bugfix/issue_978
Bugfix in interpolation and quote functions
2 parents 4c5c9f1 + d4c5731 commit 4b689ac

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

debugger.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ inline void debug_ast(AST_Node* node, string ind = "", Env* env = 0)
5454
// Expression* expression = dynamic_cast<Expression*>(node);
5555
// cerr << ind << "Expression " << expression << " " << expression->concrete_type() << endl;
5656

57+
} else if (dynamic_cast<Parent_Selector*>(node)) {
58+
Parent_Selector* selector = dynamic_cast<Parent_Selector*>(node);
59+
cerr << ind << "Parent_Selector " << selector;
60+
cerr << " <" << prettyprint(selector->pstate().token.ws_before()) << ">" << endl;
61+
debug_ast(selector->selector(), ind + "->", env);
62+
5763
} else if (dynamic_cast<Complex_Selector*>(node)) {
5864
Complex_Selector* selector = dynamic_cast<Complex_Selector*>(node);
5965
cerr << ind << "Complex_Selector " << selector

eval.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -814,6 +814,9 @@ namespace Sass {
814814
} else if (Parent_Selector* var = dynamic_cast<Parent_Selector*>(s)) {
815815
Expression* ex = var->perform(this);
816816
return evacuate_quotes(interpolation(ex));
817+
} else if (Selector* var = dynamic_cast<Selector*>(s)) {
818+
Expression* ex = var->perform(this);
819+
return evacuate_quotes(interpolation(ex));
817820
} else {
818821
To_String to_string(&ctx);
819822
// to_string.in_decl_list = true;

output.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ namespace Sass {
379379
void Output::operator()(String_Quoted* s)
380380
{
381381
if (s->quote_mark()) {
382-
append_token(quote((s->value()), s->quote_mark()), s);
382+
append_token(quote(s->value(), s->quote_mark()), s);
383383
} else if (!in_comment) {
384384
append_token(string_to_output(s->value()), s);
385385
} else {

util.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,12 +349,12 @@ namespace Sass {
349349
string quote(const string& s, char q)
350350
{
351351

352-
// return an empty quoted string
353-
if (s.empty()) return string(2, q ? q : '"');
354-
355352
// autodetect with fallback to given quote
356353
q = detect_best_quotemark(s.c_str(), q);
357354

355+
// return an empty quoted string
356+
if (s.empty()) return string(2, q ? q : '"');
357+
358358
string quoted;
359359
quoted.reserve(s.length()+2);
360360
quoted.push_back(q);

0 commit comments

Comments
 (0)