Skip to content

Commit

Permalink
Improve parser error message.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivorforce committed Apr 26, 2024
1 parent cf9b620 commit efdd0c4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/parser/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ pub fn map_parse_error(e: &ParseError<usize, Token, Error>) -> RuntimeError {
.with_note(make_expected_note(expected))
}
ParseError::UnrecognizedToken { token: (start, token, end), expected } => {
RuntimeError::error("Unrecognized token.").in_range(*start..*end)
RuntimeError::error("Unexpected token.").in_range(*start..*end)
.with_note(make_expected_note(expected))
}
ParseError::ExtraToken { token: (start, token, end) } => {
RuntimeError::error("Extra token.").in_range(*start..*end)
RuntimeError::error("Extraneous token.").in_range(*start..*end)
}
ParseError::User { error } => {
panic!()
Expand Down

0 comments on commit efdd0c4

Please sign in to comment.