fn read_identifier_or_keyword(&mut self, first: char) -> LexResult<Token> {
        let mut identifier = String::new();
        identifier.push(first);

        // Loop through all characters until no longer identifier character
        while let Some(&ch) = self.peek_char() {
            if is_identifier_char(ch) {
                identifier.push(ch);
                self.read_char();
            } else {
                break;
            }
        }

        if let Some(keyword_token) = Token::lookup_keyword(&identifier) {
            Ok(keyword_token)
        } else {
            Ok(Token::Identifier(identifier))
        }
    }
/// Read the current and following tokens as an identifier or a keyword (if it exists).
Read the current and following tokens as an identifier or a keyword (if it exists).
Read the current and following tokens as an identifier or a keyword ( if it exists ) .
fn read_identifier_or_keyword(&mut self, first: char) -> LexResult<Token> {
        let mut identifier = String::new();
        identifier.push(first);
        // Loop through all characters until no longer identifier character
        while let Some(&ch) = self.peek_char() {
            if is_identifier_char(ch) {
                identifier.push(ch);
                self.read_char();
            } else {
                break;
            }
        }
        if let Some(keyword_token) = Token::lookup_keyword(&identifier) {
            Ok(keyword_token)
        } else {
            Ok(Token::Identifier(identifier))
        }
    }
fn read_identifier_or_keyword ( & mut self , first : char ) -> LexResult < Token > { let mut identifier = String :: new ( ) ; identifier . push ( first ) ; // Loop through all characters until no longer identifier character while let Some ( & ch ) = self . peek_char ( ) { if is_identifier_char ( ch ) { identifier . push ( ch ) ; self . read_char ( ) ; } else { break ; } } if let Some ( keyword_token ) = Token :: lookup_keyword ( & identifier ) { Ok ( keyword_token ) } else { Ok ( Token :: Identifier ( identifier ) ) } }
Read the current and following tokens as an identifier or a keyword (if it exists).
Read the current and following tokens as an identifier or a keyword ( if it exists ) .
&mut self
first
char