mirror of
https://github.com/MorizzG/rlox.git
synced 2025-12-08 05:12:22 +00:00
updated error names and Display
This commit is contained in:
parent
b8741ea3cc
commit
f9fe77f1e2
7 changed files with 164 additions and 81 deletions
|
|
@ -4,13 +4,13 @@ use super::CodePos;
|
|||
|
||||
#[derive(Error, Debug)]
|
||||
pub enum LexerError {
|
||||
#[error("LexerError: Unexpected character '{c}' at {code_pos}.")]
|
||||
#[error("unexpected character '{c}' at {code_pos}.")]
|
||||
UnexpectedCharacter { c: char, code_pos: CodePos },
|
||||
#[error("LexerError: Unterminated string literal starting at {code_pos}.")]
|
||||
#[error("unterminated string literal starting at {code_pos}.")]
|
||||
UnterminatedStringLiteral { code_pos: CodePos },
|
||||
#[error("LexerError: Unterminated block comment starting at {code_pos}.")]
|
||||
#[error("unterminated block comment starting at {code_pos}.")]
|
||||
UnterminatedBlockComment { code_pos: CodePos },
|
||||
#[error("LexerError: Invalid number literal {lexeme} at {code_pos}: {msg}")]
|
||||
#[error("invalid number literal {lexeme} at {code_pos}: {msg}")]
|
||||
InvalidNumberLiteral {
|
||||
lexeme: String,
|
||||
msg: String,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue