Trait representing error handling strategies for a lexer context.
This trait allows the specification of error handling strategies for various lexer contexts by transforming a given lexer context to an instance of ErrorHandling.Strategy. The strategies determine how the lexer should proceed when it encounters an error, such as invalid tokens or characters during parsing.
Error handling is essential for customizing lexer behavior in response to specific scenarios, including ignoring or stopping on errors, or throwing specific exceptions.
Users must define an implicit instance of this trait to provide the error handling behavior for a custom lexer context.
Type parameters
Ctx
The lexer context that this error handling strategy applies to. Must be a subtype of LexerCtx.