fn break_and_eat(&mut self, expected: TokenKind) -> bool {
        if self.token.kind == expected {
            self.bump();
            return true;
        }
        match self.token.kind.break_two_token_op() {
            Some((first, second)) if first == expected => {
                let first_span = self.sess.source_map().start_point(self.token.span);
                let second_span = self.token.span.with_lo(first_span.hi());
                self.token = Token::new(first, first_span);
                self.bump_with(Token::new(second, second_span));
                true
            }
            _ => {
                self.expected_tokens.push(TokenType::Token(expected));
                false
            }
        }
    }
/// Eats the expected token if it's present possibly breaking
/// compound tokens like multi-character operators in process.
/// Returns `true` if the token was eaten.
Eats the expected token if it's present possibly breaking
compound tokens like multi-character operators in process.
Returns `true` if the token was eaten.
Eats the expected token if it ' s present possibly breaking compound tokens like multi - character operators in process . Returns ` true ` if the token was eaten .
fn break_and_eat(&mut self, expected: TokenKind) -> bool {
        if self.token.kind == expected {
            self.bump();
            return true;
        }
        match self.token.kind.break_two_token_op() {
            Some((first, second)) if first == expected => {
                let first_span = self.sess.source_map().start_point(self.token.span);
                let second_span = self.token.span.with_lo(first_span.hi());
                self.token = Token::new(first, first_span);
                self.bump_with(Token::new(second, second_span));
                true
            }
            _ => {
                self.expected_tokens.push(TokenType::Token(expected));
                false
            }
        }
    }
fn break_and_eat ( & mut self , expected : TokenKind ) -> bool { if self . token . kind == expected { self . bump ( ) ; return true ; } match self . token . kind . break_two_token_op ( ) { Some ( ( first , second ) ) if first == expected => { let first_span = self . sess . source_map ( ) . start_point ( self . token . span ) ; let second_span = self . token . span . with_lo ( first_span . hi ( ) ) ; self . token = Token :: new ( first , first_span ) ; self . bump_with ( Token :: new ( second , second_span ) ) ; true } _ => { self . expected_tokens . push ( TokenType :: Token ( expected ) ) ; false } } }
Eats the expected token if it's present possibly breaking
compound tokens like multi-character operators in process.
Eats the expected token if it ' s present possibly breaking compound tokens like multi - character operators in process .
&mut self
expected
TokenKind
&mut self
expected
TokenKind