fn eat(&mut self, lookahead: TokenType) {
        if self.current_token.ttype == lookahead {
            self.current_token = self.lexer.get_next_token();
        } else {
            panic!("Unexpected token at position {}\nExpected {:?} but got {:?}", self.lexer.pos(), lookahead, self.current_token.ttype);
        }
    }
// If the current token matches the expected type,
// consume it and get the next token from the lexer
If the current token matches the expected type,
consume it and get the next token from the lexer
If the current token matches the expected type consume it and get the next token from the lexer
fn eat(&mut self, lookahead: TokenType) {
        if self.current_token.ttype == lookahead {
            self.current_token = self.lexer.get_next_token();
        } else {
            panic!("Unexpected token at position {}\nExpected {:?} but got {:?}", self.lexer.pos(), lookahead, self.current_token.ttype);
        }
    }
fn eat ( & mut self , lookahead : TokenType ) { if self . current_token . ttype == lookahead { self . current_token = self . lexer . get_next_token ( ) ; } else { panic ! ( " \n " self lexer pos ( ) lookahead self current_token ttype ) ; } }
If the current token matches the expected type,
consume it and get the next token from the lexer
If the current token matches the expected type consume it and get the next token from the lexer
&mut self
lookahead
TokenType
&mut self
lookahead
TokenType