resolve panic from malformed filter argument

This commit is contained in:
Connor Skees 2020-08-04 01:35:49 -04:00
parent 622d44ac63
commit 55bcd1d1dd
2 changed files with 7 additions and 1 deletions

View File

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

View File

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