Commit 93dbb680 by Aaron Leung

Interpolation tweaks.

parent ee2824ef
...@@ -952,7 +952,7 @@ namespace Sass { ...@@ -952,7 +952,7 @@ namespace Sass {
} }
else { else {
// throw an error if the interpolant is unterminated // throw an error if the interpolant is unterminated
throw_syntax_error("unterminated interpolant inside string constant " + id.to_string()); throw_syntax_error("unterminated interpolant inside interpolated identifier " + id.to_string());
} }
} }
else { // no interpolants left; add the last segment if nonempty else { // no interpolants left; add the last segment if nonempty
...@@ -960,6 +960,7 @@ namespace Sass { ...@@ -960,6 +960,7 @@ namespace Sass {
break; break;
} }
} }
schema.should_eval() = true;
return schema; return schema;
} }
......
...@@ -302,7 +302,14 @@ namespace Sass { ...@@ -302,7 +302,14 @@ namespace Sass {
case value_schema: case value_schema:
case identifier_schema: { case identifier_schema: {
string result; string result;
for (size_t i = 0, S = size(); i < S; ++i) result += at(i).to_string(); for (size_t i = 0, S = size(); i < S; ++i) {
if (at(i).type() == string_constant) {
result += at(i).token().unquote();
}
else {
result += at(i).to_string();
}
}
return result; return result;
} break; } break;
......
...@@ -84,7 +84,7 @@ namespace Sass { ...@@ -84,7 +84,7 @@ namespace Sass {
// Match interpolant schemas // Match interpolant schemas
const char* identifier_schema(const char* src) { const char* identifier_schema(const char* src) {
// follows this pattern: (x*ix*)+ ... well, not quite // follows this pattern: (x*ix*)+ ... well, not quite
return one_plus< sequence< zero_plus< identifier >, return one_plus< sequence< zero_plus< alternatives< identifier, exactly<'-'> > >,
interpolant, interpolant,
zero_plus< alternatives< identifier, number, exactly<'-'> > > > >(src); zero_plus< alternatives< identifier, number, exactly<'-'> > > > >(src);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment