From c4d365a124016e87f2dbccebdb63c829187a3924 Mon Sep 17 00:00:00 2001 From: ConnorSkees <39542938+ConnorSkees@users.noreply.github.com> Date: Mon, 24 Feb 2020 19:05:50 -0500 Subject: [PATCH] Create spaced list when values are adjacent --- src/value/parse.rs | 6 +----- tests/values.rs | 5 +++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/value/parse.rs b/src/value/parse.rs index 49ded3a..ea56084 100644 --- a/src/value/parse.rs +++ b/src/value/parse.rs @@ -142,7 +142,7 @@ impl Value { }; Ok(Value::BinaryOp(Box::new(left), op, Box::new(right))) } - _ if whitespace => { + _ => { devour_whitespace_or_comment(toks); let right = match Self::from_tokens(toks, scope) { Ok(x) => x, @@ -150,10 +150,6 @@ impl Value { }; Ok(Value::List(vec![left, right], ListSeparator::Space)) } - _ => { - dbg!(&next.kind); - todo!("unimplemented token in value") - } } } diff --git a/tests/values.rs b/tests/values.rs index db76bd9..51c6ded 100644 --- a/tests/values.rs +++ b/tests/values.rs @@ -345,3 +345,8 @@ test!( "a {\n color: type-of(#foo);\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" +);