Commit 93dbb680 by Aaron Leung

Interpolation tweaks.

parent ee2824ef
......@@ -952,7 +952,7 @@ namespace Sass {
}
else {
// 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
......@@ -960,6 +960,7 @@ namespace Sass {
break;
}
}
schema.should_eval() = true;
return schema;
}
......
......@@ -302,7 +302,14 @@ namespace Sass {
case value_schema:
case identifier_schema: {
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;
} break;
......
......@@ -84,7 +84,7 @@ namespace Sass {
// Match interpolant schemas
const char* identifier_schema(const char* src) {
// 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,
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