Skip to content

Commit 1247a35

Browse files
committed
Improve handling of lexical errors.
1 parent 1f002e8 commit 1247a35

3 files changed

Lines changed: 133 additions & 45 deletions

File tree

parser/src/fstring.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::str;
55
use lalrpop_util::ParseError as LalrpopError;
66

77
use crate::ast::{ConversionFlag, StringGroup};
8-
use crate::lexer::{LexicalError, Location, Tok};
8+
use crate::lexer::{LexicalError, LexicalErrorType, Location, Tok};
99
use crate::parser::parse_expression;
1010

1111
use self::FStringError::*;
@@ -25,7 +25,10 @@ pub enum FStringError {
2525
impl From<FStringError> for LalrpopError<Location, Tok, LexicalError> {
2626
fn from(_err: FStringError) -> Self {
2727
lalrpop_util::ParseError::User {
28-
error: LexicalError::StringError,
28+
error: LexicalError {
29+
error: LexicalErrorType::StringError,
30+
location: Default::default(),
31+
},
2932
}
3033
}
3134
}

0 commit comments

Comments
 (0)