Trait teleparse::Lexer

source ·
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§

source

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.

Implementors§

source§

impl<'s, T: Logos<'s>, L: Lexicon + From<T>> Lexer<'s> for LogosLexerWrapper<'s, L, T>

§

type L = L