pub fn bump(&mut self) {
        if self.last_token_eof {
            // Bumping after EOF is a bad sign, usually an infinite loop.
            self.bug("attempted to bump the parser past EOF (may be stuck in a loop)");
        }

        if self.token == token::Eof {
            self.last_token_eof = true;
        }

        self.last_span = self.span;
        // Stash token for error recovery (sometimes; clone is not necessarily cheap).
        self.last_token = if self.token.is_ident() ||
                          self.token.is_path() ||
                          self.token == token::Comma {
            Some(Box::new(self.token.clone()))
        } else {
            None
        };
        self.last_token_interpolated = self.token.is_interpolated();
        let next = if self.buffer_start == self.buffer_end {
            self.reader.real_token()
        } else {
            // Avoid token copies with `replace`.
            let buffer_start = self.buffer_start as usize;
            let next_index = (buffer_start + 1) & 3;
            self.buffer_start = next_index as isize;

            let placeholder = TokenAndSpan {
                tok: token::Underscore,
                sp: self.span,
            };
            mem::replace(&mut self.buffer[buffer_start], placeholder)
        };
        self.span = next.sp;
        self.token = next.tok;
        self.tokens_consumed += 1;
        self.expected_tokens.clear();
        // check after each token
        self.check_unknown_macro_variable();
    }
/// Advance the parser by one token
Advance the parser by one token
Advance the parser by one token
pub fn bump(&mut self) {
        if self.last_token_eof {
            // Bumping after EOF is a bad sign, usually an infinite loop.
            self.bug("attempted to bump the parser past EOF (may be stuck in a loop)");
        }
        if self.token == token::Eof {
            self.last_token_eof = true;
        }
        self.last_span = self.span;
        // Stash token for error recovery (sometimes; clone is not necessarily cheap).
        self.last_token = if self.token.is_ident() ||
                          self.token.is_path() ||
                          self.token == token::Comma {
            Some(Box::new(self.token.clone()))
        } else {
            None
        };
        self.last_token_interpolated = self.token.is_interpolated();
        let next = if self.buffer_start == self.buffer_end {
            self.reader.real_token()
        } else {
            // Avoid token copies with `replace`.
            let buffer_start = self.buffer_start as usize;
            let next_index = (buffer_start + 1) & 3;
            self.buffer_start = next_index as isize;
            let placeholder = TokenAndSpan {
                tok: token::Underscore,
                sp: self.span,
            };
            mem::replace(&mut self.buffer[buffer_start], placeholder)
        };
        self.span = next.sp;
        self.token = next.tok;
        self.tokens_consumed += 1;
        self.expected_tokens.clear();
        // check after each token
        self.check_unknown_macro_variable();
    }
pub fn bump ( & mut self ) { if self . last_token_eof { // Bumping after EOF is a bad sign, usually an infinite loop. self . bug ( " " ) ; } if self . token == token :: Eof { self . last_token_eof = true ; } self . last_span = self . span ; // Stash token for error recovery (sometimes; clone is not necessarily cheap). self . last_token = if self . token . is_ident ( ) || self . token . is_path ( ) || self . token == token :: Comma { Some ( Box :: new ( self . token . clone ( ) ) ) } else { None } ; self . last_token_interpolated = self . token . is_interpolated ( ) ; let next = if self . buffer_start == self . buffer_end { self . reader . real_token ( ) } else { // Avoid token copies with `replace`. let buffer_start = self . buffer_start as usize ; let next_index = ( buffer_start + 1 ) & 3 ; self . buffer_start = next_index as isize ; let placeholder = TokenAndSpan { tok : token :: Underscore , sp : self . span , } ; mem :: replace ( & mut self . buffer [ buffer_start ] , placeholder ) } ; self . span = next . sp ; self . token = next . tok ; self . tokens_consumed += 1 ; self . expected_tokens . clear ( ) ; // check after each token self . check_unknown_macro_variable ( ) ; }
Advance the parser by one token
Advance the parser by one token
&mut self
&mut self