pub trait Lexer<'s> {
type L: Lexicon;
// Required method
fn next(&mut self) -> (Option<Span>, Option<Token<Self::L>>);
}Expand description
Trait for lexer
See module level documentation for more information
Required Associated Types§
Required Methods§
sourcefn next(&mut self) -> (Option<Span>, Option<Token<Self::L>>)
fn next(&mut self) -> (Option<Span>, Option<Token<Self::L>>)
Read the next token from source code
If a token cannot be produced, one character will be skipped and the lexer will try again, until one valid token is produced. The invalid skipped characters will be returned as a span (first of the tuple) and the token produced will be returned as the second of the tuple.