diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-06-26 13:57:21 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-06-27 18:40:17 +0200 |
| commit | 7b92bd7c340d9f9c094ed2fa57912049317d9b20 (patch) | |
| tree | b91399526ba94d87309d09d864df2935dd7a4d0a /src/syntax/lexer.rs | |
| parent | 9c7f31870b4e1bf37df79ebbe1df9a56df83d878 (diff) | |
Basic package management
Diffstat (limited to 'src/syntax/lexer.rs')
| -rw-r--r-- | src/syntax/lexer.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/syntax/lexer.rs b/src/syntax/lexer.rs index ae4462d9..d95b5b7b 100644 --- a/src/syntax/lexer.rs +++ b/src/syntax/lexer.rs @@ -3,7 +3,7 @@ use unicode_ident::{is_xid_continue, is_xid_start}; use unicode_segmentation::UnicodeSegmentation; use unscanny::Scanner; -use super::{ErrorPos, SyntaxKind}; +use super::SyntaxKind; /// Splits up a string of source code into tokens. #[derive(Clone)] @@ -16,7 +16,7 @@ pub(super) struct Lexer<'s> { /// Whether the last token contained a newline. newline: bool, /// An error for the last token. - error: Option<(EcoString, ErrorPos)>, + error: Option<EcoString>, } /// What kind of tokens to emit. @@ -69,7 +69,7 @@ impl<'s> Lexer<'s> { } /// Take out the last error, if any. - pub fn take_error(&mut self) -> Option<(EcoString, ErrorPos)> { + pub fn take_error(&mut self) -> Option<EcoString> { self.error.take() } } @@ -77,7 +77,7 @@ impl<'s> Lexer<'s> { impl Lexer<'_> { /// Construct a full-positioned syntax error. fn error(&mut self, message: impl Into<EcoString>) -> SyntaxKind { - self.error = Some((message.into(), ErrorPos::Full)); + self.error = Some(message.into()); SyntaxKind::Error } } |
