onigleam/errors
Types
Top-level error type that wraps all error types
pub type ConversionError {
TokenizeErr(TokenizeError)
ParseErr(ParseError)
TransformErr(TransformError)
}
Constructors
-
TokenizeErr(TokenizeError) -
ParseErr(ParseError) -
TransformErr(TransformError)
Errors that can occur during parsing
pub type ParseError {
UnexpectedToken(message: String, position: Int)
InvalidBackreference(
number: Int,
max_captures: Int,
position: Int,
)
InvalidCharacterRange(start: Int, end: Int, position: Int)
EmptyAlternation(position: Int)
ParseError(message: String, position: Int)
}
Constructors
-
UnexpectedToken(message: String, position: Int)Unexpected token encountered
-
InvalidBackreference( number: Int, max_captures: Int, position: Int, )Invalid backreference number
-
InvalidCharacterRange(start: Int, end: Int, position: Int)Invalid character range (e.g., z-a)
-
EmptyAlternation(position: Int)Empty alternation branch
-
ParseError(message: String, position: Int)Generic parse error
Errors that can occur during tokenization
pub type TokenizeError {
InvalidEscape(message: String, position: Int)
UnmatchedCloseParen(position: Int)
UnclosedGroup(position: Int)
UnclosedCharacterClass(position: Int)
InvalidGroupSyntax(message: String, position: Int)
InvalidQuantifier(message: String, position: Int)
InvalidPosixClass(name: String, position: Int)
InvalidUnicodeProperty(message: String, position: Int)
UnsupportedTokenFeature(feature: String, position: Int)
InvalidFlag(flag: String, position: Int)
TokenizeError(message: String, position: Int)
}
Constructors
-
InvalidEscape(message: String, position: Int)Invalid or incomplete escape sequence
-
UnmatchedCloseParen(position: Int)Unmatched closing parenthesis
-
UnclosedGroup(position: Int)Unclosed group (missing closing parenthesis)
-
UnclosedCharacterClass(position: Int)Unclosed character class
-
InvalidGroupSyntax(message: String, position: Int)Invalid group syntax
-
InvalidQuantifier(message: String, position: Int)Invalid quantifier
-
InvalidPosixClass(name: String, position: Int)Invalid POSIX class
-
InvalidUnicodeProperty(message: String, position: Int)Invalid Unicode property
-
UnsupportedTokenFeature(feature: String, position: Int)Unsupported feature during tokenization
-
InvalidFlag(flag: String, position: Int)Invalid flag
-
TokenizeError(message: String, position: Int)Generic tokenize error
Errors that can occur during transformation
pub type TransformError {
UnsupportedFeature(feature: String, suggestion: String)
AtomicGroupNotSupported
PossessiveQuantifierNotSupported
RecursionNotSupported
SubroutineNotSupported
SearchStartAnchorNotSupported
TransformError(message: String)
}
Constructors
-
UnsupportedFeature(feature: String, suggestion: String)Feature cannot be emulated in gleam_regexp
-
AtomicGroupNotSupportedAtomic groups cannot be emulated
-
PossessiveQuantifierNotSupportedPossessive quantifiers cannot be emulated
-
RecursionNotSupportedRecursion is not supported
-
SubroutineNotSupportedSubroutines are not supported
-
SearchStartAnchorNotSupported\G search start anchor not supported
-
TransformError(message: String)Generic transform error
Values
pub fn format_error(error: ConversionError) -> String
Format error message with position information