diff --git a/src/main.rs b/src/main.rs index 502809c..72706c5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -714,6 +714,11 @@ mod css_variables { "$a: 1px;\n$b: 1 $a;\na {\n height: $b;\n}\n", "a {\n height: 1 1px;\n}\n" ); + test!( + eats_whitespace_after_variable_value, + "a {\n b {\n $c: red;\n }\n color: red;\n}\n", + "a {\n color: red;\n}\n" + ); } #[cfg(test)] diff --git a/src/utils.rs b/src/utils.rs index 4e2ef29..cbb93c6 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -75,21 +75,6 @@ pub fn eat_variable_value>( _ => iter2.push(tok), }; } - Ok(iter2) -} - -pub fn eat_variable_value_ref<'a, I: Iterator>( - toks: &mut Peekable, - scope: &Scope, -) -> Result, (Pos, &'static str)> { devour_whitespace(toks); - let iter1 = toks.take_while(|x| x.kind != TokenKind::Symbol(Symbol::SemiColon)); - let mut iter2 = Vec::new(); - for tok in iter1 { - match tok.kind { - TokenKind::Variable(ref name) => iter2.extend(deref_variable(name, scope)), - _ => iter2.push(tok.clone()), - }; - } Ok(iter2) }