resolve panic on malformed args missing closing parenthesis

This commit is contained in:
Connor Skees 2020-08-02 22:24:37 -04:00
parent 74dad6af0c
commit 2df5e1b274
2 changed files with 6 additions and 2 deletions

View File

@ -345,9 +345,9 @@ impl<'a> Parser<'a> {
None => return Err(("expected \")\".", span).into()), None => return Err(("expected \")\".", span).into()),
} }
} }
Some(c) => { Some(Token { pos, .. }) => {
value?; value?;
unreachable!("{:?}", c) return Err(("expected \")\".", *pos).into());
} }
None => return Err(("expected \")\".", span).into()), None => return Err(("expected \")\".", span).into()),
} }

View File

@ -168,6 +168,10 @@ error!(
filter_value_after_equal_is_last_char, filter_value_after_equal_is_last_char,
"a {\n color: foo(a=a", "Error: expected \")\"." "a {\n color: foo(a=a", "Error: expected \")\"."
); );
error!(
unclosed_paren_in_nested_args,
"a { color: a(b(red); }", "Error: expected \")\"."
);
test!( test!(
space_after_loud_comment, space_after_loud_comment,
"@mixin foo($x) { "@mixin foo($x) {