Expand description
Predefined callback that will inform the Lexer
to skip a definition.
Example
use logos::Logos;
#[derive(Logos, Debug, PartialEq)]
enum Token<'a> {
// We will treat "abc" as if it was whitespace
#[regex(" |abc", logos::skip)]
#[error]
Error,
#[regex("[a-zA-Z]+")]
Text(&'a str),
}
let tokens: Vec<_> = Token::lexer("Hello abc world").collect();
assert_eq!(
tokens,
&[
Token::Text("Hello"),
Token::Text("world"),
],
);