pub trait Tokens {
    type Error;

    // Required methods
    fn peek(
        &mut self
    ) -> Result<Meta<Option<&Token>, Span>, Meta<Self::Error, Span>>;
    fn next(
        &mut self
    ) -> Result<Meta<Option<Token>, Span>, Meta<Self::Error, Span>>;
    fn last(&self) -> Span;
}
Expand description

Fallible tokens iterator with lookahead.

Required Associated Types§

Required Methods§

source

fn peek( &mut self ) -> Result<Meta<Option<&Token>, Span>, Meta<Self::Error, Span>>

source

fn next(&mut self) -> Result<Meta<Option<Token>, Span>, Meta<Self::Error, Span>>

source

fn last(&self) -> Span

Returns the span of the last parsed token.

Implementors§

source§

impl<E, C: Iterator<Item = Result<DecodedChar, E>>> Tokens for Lexer<C, E>

§

type Error = Error<E>