fn object(&mut self) {
        // Consume the opening bracket
        self.eat(TokenType::OPBR);

        // Consume the key value pairs
        while self.current_token.ttype != TokenType::CLBR {
            self.pair();

            // If there is another key value pair, the current token should be a comma
            // Consume it and keep going, otherwise break
            if self.current_token.ttype == TokenType::COMMA {
                self.eat(TokenType::COMMA);
            } else {
                break;
            }
        }

        // Consume the closing bracket
        self.eat(TokenType::CLBR)
    }
// A function used to consume an array in a json file (i.e. {"key1": value1, "key2": value2, ...})
A function used to consume an array in a json file
A function used to consume an array in a json file
fn object(&mut self) {
        // Consume the opening bracket
        self.eat(TokenType::OPBR);
        // Consume the key value pairs
        while self.current_token.ttype != TokenType::CLBR {
            self.pair();
            // If there is another key value pair, the current token should be a comma
            // Consume it and keep going, otherwise break
            if self.current_token.ttype == TokenType::COMMA {
                self.eat(TokenType::COMMA);
            } else {
                break;
            }
        }
        // Consume the closing bracket
        self.eat(TokenType::CLBR)
    }
fn object ( & mut self ) { // Consume the opening bracket self . eat ( TokenType :: OPBR ) ; // Consume the key value pairs while self . current_token . ttype != TokenType :: CLBR { self . pair ( ) ; // If there is another key value pair, the current token should be a comma // Consume it and keep going, otherwise break if self . current_token . ttype == TokenType :: COMMA { self . eat ( TokenType :: COMMA ) ; } else { break ; } } // Consume the closing bracket self . eat ( TokenType :: CLBR ) }
A function used to consume an array in a json file (i.e.
A function used to consume an array in a json file ( i . e .
&mut self
&mut self