pub fn peek_n(&mut self, n: usize) -> Option<Token> {
        while self.peeked_tokens.len() - self.current_peek_index <= n {
            let span = self.lexer.span;
            let slice = self.lexer.slice();
            let indent = self.lexer.indent;
            let source_position = self.lexer.current_byte;
            // getting the token needs to happen after the other properties
            let token = self.lexer.next();
            self.peeked_tokens.push(PeekedToken {
                token,
                slice,
                span,
                indent,
                source_position,
            });
        }
        self.peeked_tokens[self.current_peek_index + n].token
    }
/// Peeks the nth token that will appear in the output stream
///
/// peek_n(0) is equivalent to calling peek().
/// peek_n(1) returns the token that will appear after that, and so forth.
Peeks the nth token that will appear in the output stream
peek_n(0) is equivalent to calling peek().
peek_n(1) returns the token that will appear after that, and so forth.
Peeks the nth token that will appear in the output stream peek_n ( 0 ) is equivalent to calling peek () . peek_n ( 1 ) returns the token that will appear after that and so forth .
pub fn peek_n(&mut self, n: usize) -> Option<Token> {
        while self.peeked_tokens.len() - self.current_peek_index <= n {
            let span = self.lexer.span;
            let slice = self.lexer.slice();
            let indent = self.lexer.indent;
            let source_position = self.lexer.current_byte;
            // getting the token needs to happen after the other properties
            let token = self.lexer.next();
            self.peeked_tokens.push(PeekedToken {
                token,
                slice,
                span,
                indent,
                source_position,
            });
        }
        self.peeked_tokens[self.current_peek_index + n].token
    }
pub fn peek_n ( & mut self , n : usize ) -> Option < Token > { while self . peeked_tokens . len ( ) - self . current_peek_index <= n { let span = self . lexer . span ; let slice = self . lexer . slice ( ) ; let indent = self . lexer . indent ; let source_position = self . lexer . current_byte ; // getting the token needs to happen after the other properties let token = self . lexer . next ( ) ; self . peeked_tokens . push ( PeekedToken { token , slice , span , indent , source_position , } ) ; } self . peeked_tokens [ self . current_peek_index + n ] . token }
Peeks the nth token that will appear in the output stream
peek_n(0) is equivalent to calling peek().
Peeks the nth token that will appear in the output stream peek_n ( 0 ) is equivalent to calling peek () .
&mut self
n
usize
&mut self
n
usize