correctly parse idents starting with interpolation

This commit is contained in:
ConnorSkees 2020-05-14 00:10:19 -04:00
parent 4b15b27119
commit 374e9f9eb4
2 changed files with 7 additions and 5 deletions

View File

@ -722,11 +722,8 @@ impl Value {
})
}
'#' => {
if let Ok(s) = eat_ident(toks, scope, super_selector) {
IntermediateValue::Value(Spanned {
node: Value::Ident(s.node, QuoteKind::None),
span: s.span,
})
if let Ok(s) = Self::ident(toks, scope, super_selector) {
s
} else {
IntermediateValue::Value(match parse_hex(toks, scope, super_selector, span) {
Ok(v) => v,

View File

@ -68,3 +68,8 @@ test!(
"a {\n color: \"#{\\\"\\'}\";\n}\n",
"a {\n color: \"\\\\\\\"\\\\'\";\n}\n"
);
test!(
interpolated_plain_css_fn,
"$f: foo;\na {\n color: #{$f}(a, 1+2, c);\n}\n",
"a {\n color: foo(a, 3, c);\n}\n"
);