unquoted plus quoted is unquoted
This commit is contained in:
parent
bd426b9fab
commit
d48560781c
@ -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())
|
||||
}
|
||||
|
@ -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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user