mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-24 21:44:45 +00:00
Merge pull request #4384 from harupy/parse-formatted-value
Fix the location of `FormattedValue`
This commit is contained in:
commit
9d7d629cef
22 changed files with 2195 additions and 355 deletions
|
@ -101,6 +101,15 @@ pub enum FStringErrorType {
|
|||
UnterminatedString,
|
||||
}
|
||||
|
||||
impl FStringErrorType {
|
||||
pub fn to_lexical_error(self, location: Location) -> LexicalError {
|
||||
LexicalError {
|
||||
error: LexicalErrorType::FStringError(self),
|
||||
location,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for FStringErrorType {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
match self {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue