pub trait TokenStream {
    fn advance(&mut self) -> bool;
    fn token(&self) -> &Token;
    fn token_mut(&mut self) -> &mut Token;

    fn next(&mut self) -> Option<&Token> { ... }
    fn process(&mut self, sink: &mut dyn FnMut(&Token)) { ... }
}
Expand description

TokenStream is the result of the tokenization.

It consists consumable stream of Tokens.

Required Methods§

Advance to the next token

Returns false if there are no other tokens.

Returns a reference to the current token.

Returns a mutable reference to the current token.

Provided Methods§

Helper to iterate over tokens. It simply combines a call to .advance() and .token().

Helper function to consume the entire TokenStream and push the tokens to a sink function.

Trait Implementations§

Advance to the next token Read more
Returns a reference to the current token.
Returns a mutable reference to the current token.
Helper to iterate over tokens. It simply combines a call to .advance() and .token().
Helper function to consume the entire TokenStream and push the tokens to a sink function.

Implementations on Foreign Types§

Implementors§