[][src]Trait hinku::TokenStream

pub trait TokenStream<T> {
    fn advance(&mut self) -> Option<(T, Span)>;
fn backtrack(&mut self, n: usize);
fn commit(&mut self); }

Token stream with backtracking support.

Required methods

fn advance(&mut self) -> Option<(T, Span)>

Returns the token and it's span from the current position in the token stream.

fn backtrack(&mut self, n: usize)

Backtracks n tokens in the stream.

fn commit(&mut self)

Mark the tokens before the current position in the stream as unneeded. The stream cannot be backtracked past this in the future.

Loading content...

Trait Implementations

impl<'a, '_, T> TokenStream<T> for &'_ mut dyn TokenStream<T>[src]

Implementors

impl<'a, '_, T> TokenStream<T> for &'_ mut dyn TokenStream<T>[src]

impl<'a, S, T> TokenStream<T> for SpanningStream<'a, S> where
    S: TokenStream<T>, 
[src]

impl<'a, T> TokenStream<T> for BufferedLexer<'a, T> where
    T: Logos<'a> + Clone + Debug
[src]

impl<'a, T> TokenStream<T> for TokenStreamFork<'a, T>[src]

Loading content...