fn read_number_suffix<Chars: Iterator<Item=char>>(int_token: Token, unsigned_token: Token, buffer: &mut TokenReadBuffer<Chars>, location: FileLocation) -> (Token, String, FileLocation) {
    // Numbers are followed by 'u' or 'i' to indicate that they contain a certain number of bits
    let next_char   = buffer.read_next();
    let token       = match next_char {
        Some('u')   => unsigned_token,
        Some('i')   => int_token,
        None        => {
            return (int_token, buffer.read_characters(), buffer.update_location(location))
        }
        _           => {
            buffer.push_back();
            return (int_token, buffer.read_characters(), buffer.update_location(location))
        }
    };

    // Should be followed by a number
    let mut num_bits = 0;
    loop {
        let bit_count   = buffer.read_next();
        match bit_count {
            Some(num) => {
                if num >= '0' && num <= '9' {
                } else {
                    buffer.push_back();
                    break;
                }
            }
            None => { 
                break;
            }
        }

        num_bits += 1;
    }

    // Should be at least one bit character (up to 2 is sensible, though we use 128-bit numbers everywhere, so 3 is also possible)
    if num_bits == 0 {
        buffer.push_back();
        return (int_token, buffer.read_characters(), buffer.update_location(location))
    }

    (token, buffer.read_characters(), buffer.update_location(location))
}
///
/// Reads the 'u5' or 'i4' bit count suffix from a number
///
Reads the 'u5' or 'i4' bit count suffix from a number
Reads the ' u5 ' or ' i4 ' bit count suffix from a number
fn read_number_suffix<Chars: Iterator<Item=char>>(int_token: Token, unsigned_token: Token, buffer: &mut TokenReadBuffer<Chars>, location: FileLocation) -> (Token, String, FileLocation) {
    // Numbers are followed by 'u' or 'i' to indicate that they contain a certain number of bits
    let next_char   = buffer.read_next();
    let token       = match next_char {
        Some('u')   => unsigned_token,
        Some('i')   => int_token,
        None        => {
            return (int_token, buffer.read_characters(), buffer.update_location(location))
        }
        _           => {
            buffer.push_back();
            return (int_token, buffer.read_characters(), buffer.update_location(location))
        }
    };
    // Should be followed by a number
    let mut num_bits = 0;
    loop {
        let bit_count   = buffer.read_next();
        match bit_count {
            Some(num) => {
                if num >= '0' && num <= '9' {
                } else {
                    buffer.push_back();
                    break;
                }
            }
            None => { 
                break;
            }
        }
        num_bits += 1;
    }
    // Should be at least one bit character (up to 2 is sensible, though we use 128-bit numbers everywhere, so 3 is also possible)
    if num_bits == 0 {
        buffer.push_back();
        return (int_token, buffer.read_characters(), buffer.update_location(location))
    }
    (token, buffer.read_characters(), buffer.update_location(location))
}
fn read_number_suffix < Chars : Iterator < Item = char > > ( int_token : Token , unsigned_token : Token , buffer : & mut TokenReadBuffer < Chars > , location : FileLocation ) -> ( Token , String , FileLocation ) { // Numbers are followed by 'u' or 'i' to indicate that they contain a certain number of bits let next_char = buffer . read_next ( ) ; let token = match next_char { Some ( 'u' ) => unsigned_token , Some ( 'i' ) => int_token , None => { return ( int_token , buffer . read_characters ( ) , buffer . update_location ( location ) ) } _ => { buffer . push_back ( ) ; return ( int_token , buffer . read_characters ( ) , buffer . update_location ( location ) ) } } ; // Should be followed by a number let mut num_bits = 0 ; loop { let bit_count = buffer . read_next ( ) ; match bit_count { Some ( num ) => { if num >= '0' && num <= '9' { } else { buffer . push_back ( ) ; break ; } } None => { break ; } } num_bits += 1 ; } // Should be at least one bit character (up to 2 is sensible, though we use 128-bit numbers everywhere, so 3 is also possible) if num_bits == 0 { buffer . push_back ( ) ; return ( int_token , buffer . read_characters ( ) , buffer . update_location ( location ) ) } ( token , buffer . read_characters ( ) , buffer . update_location ( location ) ) }
Reads the 'u5' or 'i4' bit count suffix from a number
Reads the ' u5 ' or ' i4 ' bit count suffix from a number
int_token
Token
unsigned_token
Token
buffer
&mut TokenReadBuffer<Chars>
location
FileLocation
int_token
Token
unsigned_token
Token
buffer
&mut TokenReadBuffer<Chars>
location
FileLocation