fn consume(&mut self) -> Result<Token, Box<dyn Error>> {
        let next_token = if self.next_token.is_some() {
            self.next_token.take().unwrap()
        } else if self.current_token.is_none() {
            return Err("Unable to consume tokens when none are available.".into());
        } else {
            self.token_generator.next_token()?
        };

        let current_token_clone = self.current_token.replace(next_token);

        // Safe to unwrap since we know that it contains something
        Ok(current_token_clone.unwrap())
    }
// Consume current_token and load next token as the current_token
Consume current_token and load next token as the current_token
Consume current_token and load next token as the current_token
fn consume(&mut self) -> Result<Token, Box<dyn Error>> {
        let next_token = if self.next_token.is_some() {
            self.next_token.take().unwrap()
        } else if self.current_token.is_none() {
            return Err("Unable to consume tokens when none are available.".into());
        } else {
            self.token_generator.next_token()?
        };
        let current_token_clone = self.current_token.replace(next_token);
        // Safe to unwrap since we know that it contains something
        Ok(current_token_clone.unwrap())
    }
fn consume ( & mut self ) -> Result < Token , Box < dyn Error > > { let next_token = if self . next_token . is_some ( ) { self . next_token . take ( ) . unwrap ( ) } else if self . current_token . is_none ( ) { return Err ( " " . into ( ) ) ; } else { self . token_generator . next_token ( ) ? } ; let current_token_clone = self . current_token . replace ( next_token ) ; // Safe to unwrap since we know that it contains something Ok ( current_token_clone . unwrap ( ) ) }
Consume current_token and load next token as the current_token
Consume current_token and load next token as the current_token
&mut self