fn array(&mut self) {
        // Consume the opening square bracket
        self.eat(TokenType::OPSQ);

        // Consume values as long as they exist
        while self.current_token.ttype != TokenType::CLSQ {
            self.value();

            // If there is another value, 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 final square bracket of the array
        self.eat(TokenType::CLSQ);
    }
// A function used to consume an array in a json file (i.e. [value, value])
A function used to consume an array in a json file
A function used to consume an array in a json file
fn array(&mut self) {
        // Consume the opening square bracket
        self.eat(TokenType::OPSQ);
        // Consume values as long as they exist
        while self.current_token.ttype != TokenType::CLSQ {
            self.value();
            // If there is another value, 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 final square bracket of the array
        self.eat(TokenType::CLSQ);
    }
fn array ( & mut self ) { // Consume the opening square bracket self . eat ( TokenType :: OPSQ ) ; // Consume values as long as they exist while self . current_token . ttype != TokenType :: CLSQ { self . value ( ) ; // If there is another value, 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 final square bracket of the array self . eat ( TokenType :: CLSQ ) ; }
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