better heuristics when no space between colon and style

This commit is contained in:
ConnorSkees 2020-04-01 19:35:04 -04:00
parent de6b823440
commit bd426b9fab
2 changed files with 10 additions and 1 deletions

View File

@ -546,7 +546,11 @@ pub(crate) fn eat_expr<I: Iterator<Item = Token>>(
return Ok(Some(Expr::VariableDecl(name, Box::new(val)))); return Ok(Some(Expr::VariableDecl(name, Box::new(val))));
} }
} else { } else {
todo!() values.push(tok);
// HACK: we add the name back in, but lose the position information
// potentially requires refactoring heuristics for
// no space between colon and style value
values.extend(name.chars().map(|c| Token::new(Pos::new(), c)));
} }
} }
'/' => { '/' => {

View File

@ -105,3 +105,8 @@ test!(
values_after_important, values_after_important,
"a {\n color: foo bar !important hux baz;\n}\n" "a {\n color: foo bar !important hux baz;\n}\n"
); );
test!(
no_space_between_colon_and_style_variable,
"$base-color: #036;\na {\n color:lighten($base-color, 5%);\n}",
"a {\n color: #004080;\n}\n"
);