use logos::Logos; #[derive(Logos, Debug, PartialEq)] #[logos(skip r"[ \t\n\f]+")] // Ignore this regex pattern between tokens enum Token { // Tokens can be literal strings, of any length. #[token("protocol")] Protocol, #[token(".")] Period, // Or regular expressions. #[regex("[a-zA-Z]+")] Text, } pub fn main() { let mut lex = Token::lexer("Create ridiculously fast Lexers."); }