mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-09 14:15:22 +00:00
Remove incorrect EmptyExpression in parse_formatted_value
This commit is contained in:
parent
b6647b0171
commit
674ab0d55e
2 changed files with 2 additions and 6 deletions
|
@ -42,7 +42,7 @@ impl fmt::Display for LexicalErrorType {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
match self {
|
match self {
|
||||||
LexicalErrorType::StringError => write!(f, "Got unexpected string"),
|
LexicalErrorType::StringError => write!(f, "Got unexpected string"),
|
||||||
LexicalErrorType::FStringError(error) => write!(f, "Got error in f-string: {error}"),
|
LexicalErrorType::FStringError(error) => write!(f, "f-string: {error}"),
|
||||||
LexicalErrorType::UnicodeError => write!(f, "Got unexpected unicode"),
|
LexicalErrorType::UnicodeError => write!(f, "Got unexpected unicode"),
|
||||||
LexicalErrorType::NestingError => write!(f, "Got unexpected nesting"),
|
LexicalErrorType::NestingError => write!(f, "Got unexpected nesting"),
|
||||||
LexicalErrorType::IndentationError => {
|
LexicalErrorType::IndentationError => {
|
||||||
|
|
|
@ -358,11 +358,7 @@ impl<'a> StringParser<'a> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Err(if expression.trim().is_empty() {
|
Err(FStringError::new(UnclosedLbrace, self.get_pos()).into())
|
||||||
FStringError::new(EmptyExpression, self.get_pos()).into()
|
|
||||||
} else {
|
|
||||||
FStringError::new(UnclosedLbrace, self.get_pos()).into()
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn parse_spec(&mut self, nested: u8) -> Result<Vec<Expr>, LexicalError> {
|
fn parse_spec(&mut self, nested: u8) -> Result<Vec<Expr>, LexicalError> {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue