Remove quotes from interpolation (naively)
This commit is contained in:
parent
1c5c8e0650
commit
7975d468f1
@ -48,6 +48,9 @@ pub(crate) fn eat_interpolation<I: Iterator<Item = Token>>(
|
||||
while let Some(tok) = tokens.next() {
|
||||
match tok.kind {
|
||||
TokenKind::Symbol(Symbol::CloseCurlyBrace) => break,
|
||||
TokenKind::Symbol(Symbol::SingleQuote) | TokenKind::Symbol(Symbol::DoubleQuote) => {
|
||||
continue
|
||||
}
|
||||
TokenKind::Symbol(Symbol::OpenCurlyBrace) => {
|
||||
todo!("invalid character in interpolation")
|
||||
}
|
||||
|
@ -520,6 +520,21 @@ mod test_misc {
|
||||
);
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test_interpolation {
|
||||
use super::*;
|
||||
test!(
|
||||
removes_double_quotes,
|
||||
"a {\n color: #{\"red\"};\n}\n",
|
||||
"a {\n color: red;\n}\n"
|
||||
);
|
||||
test!(
|
||||
removes_single_quotes,
|
||||
"a {\n color: #{'red'};\n}\n",
|
||||
"a {\n color: red;\n}\n"
|
||||
);
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test_mixins {
|
||||
use super::*;
|
||||
|
Loading…
x
Reference in New Issue
Block a user