Merge pull request #4384 from harupy/parse-formatted-value

Fix the location of `FormattedValue`
This commit is contained in:
Jeong YunWon 2022-12-31 10:52:44 +09:00 committed by GitHub
commit 9d7d629cef
22 changed files with 2195 additions and 355 deletions

View file

@ -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 {