remove panic on malformed bracketed list

This commit is contained in:
Connor Skees 2020-08-04 02:18:48 -04:00
parent 9c2d1200f7
commit 5c8e88d16b
2 changed files with 9 additions and 2 deletions

View File

@ -259,7 +259,7 @@ pub(crate) fn read_until_closing_square_brace(
continue; continue;
} }
'\\' => { '\\' => {
t.push(toks.next().unwrap()); t.push(tok);
t.push(match toks.next() { t.push(match toks.next() {
Some(tok) => tok, Some(tok) => tok,
None => continue, None => continue,

View File

@ -245,4 +245,11 @@ error!(
"a {foo: {bar: red", "Error: Expected identifier." "a {foo: {bar: red", "Error: Expected identifier."
); );
error!(toplevel_nullbyte, "\u{0}", "Error: expected selector."); error!(toplevel_nullbyte, "\u{0}", "Error: expected selector.");
error!(double_escaped_bang_at_toplevel, "\\!\\!", "Error: expected \"{\"."); error!(
double_escaped_bang_at_toplevel,
"\\!\\!", "Error: expected \"{\"."
);
error!(
nothing_after_escape_inside_brackets,
"a { color: [\\", "Error: expected \"]\"."
);