unquoted plus quoted is unquoted

This commit is contained in:
ConnorSkees 2020-04-01 21:43:58 -04:00
parent bd426b9fab
commit d48560781c
2 changed files with 1 additions and 12 deletions

View File

@ -77,16 +77,7 @@ impl Add for Value {
}
Self::UnaryOp(..) | Self::Paren(..) => (self.eval()? + other)?,
Self::Ident(s1, quotes1) => match other {
Self::Ident(s2, quotes2) => {
let quotes = match (quotes1, quotes2) {
(QuoteKind::Double, _)
| (QuoteKind::Single, _)
| (_, QuoteKind::Double)
| (_, QuoteKind::Single) => QuoteKind::Double,
_ => QuoteKind::None,
};
Value::Ident(format!("{}{}", s1, s2), quotes)
}
Self::Ident(s2, _) => Value::Ident(format!("{}{}", s1, s2), quotes1.normalize()),
Self::Important | Self::True | Self::False | Self::Dimension(..) => {
Value::Ident(format!("{}{}", s1, other), quotes1.normalize())
}

View File

@ -54,13 +54,11 @@ test!(
"a {\n color: \"foobar\";\n}\n"
);
test!(
#[ignore]
unquoted_plus_dblquoted,
"a {\n color: foo + \"bar\";\n}\n",
"a {\n color: foobar;\n}\n"
);
test!(
#[ignore]
unquoted_plus_sglquoted,
"a {\n color: foo + 'bar';\n}\n",
"a {\n color: foobar;\n}\n"