don't expose lexical error and provide location

This commit is contained in:
Skgland
2026-01-24 03:32:42 +01:00
committed by Bennet Bleßmann
parent 18b476af28
commit d8c6fa1fe5
2 changed files with 18 additions and 24 deletions

View File

@@ -461,7 +461,7 @@ pub enum ParserErrorKind {
IncompleteReduction,
InfiniteFloat,
InvalidSingleQuotedCharacter(char),
LexicalError(lexical::Error),
ParseFloat,
MissingQuote,
NonPrologChar,
ParseBigInt,
@@ -492,7 +492,7 @@ impl ParserError {
atom!("invalid_data")
}
ParserErrorKind::IO(_) => atom!("input_output_error"),
ParserErrorKind::LexicalError(_) => atom!("lexical_error"),
ParserErrorKind::ParseFloat => atom!("parse_float"),
ParserErrorKind::MissingQuote => atom!("missing_quote"),
ParserErrorKind::NonPrologChar => atom!("non_prolog_character"),
ParserErrorKind::ParseBigInt => atom!("cannot_parse_big_int"),
@@ -519,15 +519,6 @@ impl ParserError {
}
}
impl From<lexical::Error> for ParserError {
fn from(e: lexical::Error) -> ParserError {
ParserError {
location: None,
kind: ParserErrorKind::LexicalError(e),
}
}
}
impl From<IOError> for ParserError {
fn from(e: IOError) -> ParserError {
ParserError {