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::UnaryOp(..) | Self::Paren(..) => (self.eval()? + other)?,
|
||||||
Self::Ident(s1, quotes1) => match other {
|
Self::Ident(s1, quotes1) => match other {
|
||||||
Self::Ident(s2, quotes2) => {
|
Self::Ident(s2, _) => Value::Ident(format!("{}{}", s1, s2), quotes1.normalize()),
|
||||||
let quotes = match (quotes1, quotes2) {
|
|
||||||
(QuoteKind::Double, _)
|
|
||||||
| (QuoteKind::Single, _)
|
|
||||||
| (_, QuoteKind::Double)
|
|
||||||
| (_, QuoteKind::Single) => QuoteKind::Double,
|
|
||||||
_ => QuoteKind::None,
|
|
||||||
};
|
|
||||||
Value::Ident(format!("{}{}", s1, s2), quotes)
|
|
||||||
}
|
|
||||||
Self::Important | Self::True | Self::False | Self::Dimension(..) => {
|
Self::Important | Self::True | Self::False | Self::Dimension(..) => {
|
||||||
Value::Ident(format!("{}{}", s1, other), quotes1.normalize())
|
Value::Ident(format!("{}{}", s1, other), quotes1.normalize())
|
||||||
}
|
}
|
||||||
|
@ -54,13 +54,11 @@ test!(
|
|||||||
"a {\n color: \"foobar\";\n}\n"
|
"a {\n color: \"foobar\";\n}\n"
|
||||||
);
|
);
|
||||||
test!(
|
test!(
|
||||||
#[ignore]
|
|
||||||
unquoted_plus_dblquoted,
|
unquoted_plus_dblquoted,
|
||||||
"a {\n color: foo + \"bar\";\n}\n",
|
"a {\n color: foo + \"bar\";\n}\n",
|
||||||
"a {\n color: foobar;\n}\n"
|
"a {\n color: foobar;\n}\n"
|
||||||
);
|
);
|
||||||
test!(
|
test!(
|
||||||
#[ignore]
|
|
||||||
unquoted_plus_sglquoted,
|
unquoted_plus_sglquoted,
|
||||||
"a {\n color: foo + 'bar';\n}\n",
|
"a {\n color: foo + 'bar';\n}\n",
|
||||||
"a {\n color: foobar;\n}\n"
|
"a {\n color: foobar;\n}\n"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user