From 430747d06b59a0f882d133b9705d451bd3aee876 Mon Sep 17 00:00:00 2001 From: ConnorSkees <39542938+ConnorSkees@users.noreply.github.com> Date: Mon, 23 Mar 2020 23:19:13 -0400 Subject: [PATCH] handle empty bracketed lists --- src/value/parse.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/value/parse.rs b/src/value/parse.rs index ab6dcd7..0531629 100644 --- a/src/value/parse.rs +++ b/src/value/parse.rs @@ -278,6 +278,12 @@ impl Value { parse_quoted_string(toks, scope, &q, super_selector) } TokenKind::Symbol(Symbol::OpenSquareBrace) => { + if let Some(tok) = toks.peek() { + if tok.is_symbol(Symbol::CloseSquareBrace) { + toks.next(); + return Ok(Value::List(Vec::new(), ListSeparator::Space, Brackets::Bracketed)); + } + } let inner = Self::from_tokens(toks, scope, super_selector)?; devour_whitespace_or_comment(toks); toks.next();