We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bb40417 commit e517951Copy full SHA for e517951
crates/ruff_python_parser/src/parser/expression.rs
@@ -1685,14 +1685,14 @@ impl<'src> Parser<'src> {
1685
return;
1686
}
1687
tok => {
1688
- // This should never happen because the list parsing will only
1689
- // call this closure for the above token kinds which are the same
1690
- // as in the FIRST set.
1691
- unreachable!(
1692
- "{}: unexpected token `{tok:?}` at {:?}",
1693
- string_kind,
1694
- parser.current_token_range()
+ parser.add_error(
+ ParseErrorType::OtherError(format!(
+ "{string_kind}: unexpected token `{tok:?}`"
+ )),
+ parser.current_token_range(),
1695
);
+ parser.bump_any();
+ return;
1696
1697
};
1698
elements.push(element);
0 commit comments