Create spaced list when values are adjacent

This commit is contained in:
ConnorSkees 2020-02-24 19:05:50 -05:00
parent fba6f2eb73
commit c4d365a124
2 changed files with 6 additions and 5 deletions

View File

@ -142,7 +142,7 @@ impl Value {
}; };
Ok(Value::BinaryOp(Box::new(left), op, Box::new(right))) Ok(Value::BinaryOp(Box::new(left), op, Box::new(right)))
} }
_ if whitespace => { _ => {
devour_whitespace_or_comment(toks); devour_whitespace_or_comment(toks);
let right = match Self::from_tokens(toks, scope) { let right = match Self::from_tokens(toks, scope) {
Ok(x) => x, Ok(x) => x,
@ -150,10 +150,6 @@ impl Value {
}; };
Ok(Value::List(vec![left, right], ListSeparator::Space)) Ok(Value::List(vec![left, right], ListSeparator::Space))
} }
_ => {
dbg!(&next.kind);
todo!("unimplemented token in value")
}
} }
} }

View File

@ -345,3 +345,8 @@ test!(
"a {\n color: type-of(#foo);\n}\n", "a {\n color: type-of(#foo);\n}\n",
"a {\n color: string;\n}\n" "a {\n color: string;\n}\n"
); );
test!(
adjacent_strings_get_spaced,
"a {\n color: \"f\"foo;\n}\n",
"a {\n color: \"f\" foo;\n}\n"
);