NthToken

Trait NthToken 

Source
pub trait NthToken<Lex>: TokenSource {
    // Required methods
    fn nth(&mut self, n: usize) -> Self::Kind;
    fn has_nth_preceding_line_break(&mut self, n: usize) -> bool;
}
Expand description

Token source that supports inspecting the ‘nth’ token (lookahead)

Required Methods§

Source

fn nth(&mut self, n: usize) -> Self::Kind

Gets the kind of the nth non-trivia token

Source

fn has_nth_preceding_line_break(&mut self, n: usize) -> bool

Returns true if the nth non-trivia token is preceded by a line break

Implementors§

Source§

impl<'l, Lex, T> NthToken<Lex> for T
where T: TokenSourceWithBufferedLexer<Lex>, Lex: LexerWithCheckpoint<'l, Kind = <T as TokenSource>::Kind>,