parse_error
Types
pub type ParseError {
EmptyString
WhitespaceOnlyString
InvalidUnderscorePosition(index: Int)
InvalidDecimalPosition(index: Int)
InvalidSignPosition(character: String, index: Int)
InvalidDigitPosition(character: String, index: Int)
InvalidExponentSymbolPosition(character: String, index: Int)
UnknownCharacter(character: String, index: Int)
}
Constructors
-
EmptyString
Represents an error when the input string is empty.
-
WhitespaceOnlyString
Represents an error when the input string contains only whitespace characters.
-
InvalidUnderscorePosition(index: Int)
Represents an error when an underscore is in an invalid position within the number string.
index
: The position of the invalid underscore in the input string.
-
InvalidDecimalPosition(index: Int)
Represents an error when a decimal point is in an invalid position within the number string.
index
: The position of the invalid decimal point in the input string.
-
InvalidSignPosition(character: String, index: Int)
Represents an error when a sign (+ or -) is in an invalid position within the number string.
character
: The sign character that caused the error as aString
.index
: The position of the invalid sign in the input string.
-
InvalidDigitPosition(character: String, index: Int)
Represents an error when a digit is in an invalid position within the number string.
character
: The digit character that caused the error as aString
.index
: The position of the invalid digit in the input string.
-
InvalidExponentSymbolPosition(character: String, index: Int)
Represents an error when an exponent symbol (e or E) is in an invalid position within the number string.
character
: The exponent symbol that caused the error as aString
.index
: The position of the invalid exponent symbol in the input string.
-
UnknownCharacter(character: String, index: Int)
Represents an error when an invalid character is encountered during parsing.
character
: The invalid character as aString
.index
: The position of the invalid character in the input string.