fn interpret_int(&mut self, lit: &str, base: u32, token_name: &str) -> PResult<BigInt> {
        trace!("interpret_int");

        let mut res = BigInt::from(0u8);

        for c in lit.chars() {
            if let Some(d) = c.to_digit(base) {
                res = res * BigInt::from(base);
                res = res + BigInt::from(d);
            } else {
                let msg = format!("invalid character in {}: {}", token_name, c);
                return Err(self.err(ErrorKind::other(msg)));
            }
        }

        Ok(res)
    }
/// Interpret the value of an int literal and return the result as a BigInt, using the provided
/// base.
///
/// Use `token_name` to specify what type of literal this is, for error messages. To
/// parse an octal or hex literal, do not pass the `0` or `0x` prefixes.
Interpret the value of an int literal and return the result as a BigInt, using the provided
base.

Use `token_name` to specify what type of literal this is, for error messages. To
parse an octal or hex literal, do not pass the `0` or `0x` prefixes.
Interpret the value of an int literal and return the result as a BigInt using the provided base . Use ` token_name ` to specify what type of literal this is for error messages . To parse an octal or hex literal do not pass the ` 0 ` or ` 0x ` prefixes .
fn interpret_int(&mut self, lit: &str, base: u32, token_name: &str) -> PResult<BigInt> {
        trace!("interpret_int");
        let mut res = BigInt::from(0u8);
        for c in lit.chars() {
            if let Some(d) = c.to_digit(base) {
                res = res * BigInt::from(base);
                res = res + BigInt::from(d);
            } else {
                let msg = format!("invalid character in {}: {}", token_name, c);
                return Err(self.err(ErrorKind::other(msg)));
            }
        }
        Ok(res)
    }
fn interpret_int ( & mut self , lit : & str , base : u32 , token_name : & str ) -> PResult < BigInt > { trace ! ( " " ) ; let mut res = BigInt :: from ( 0u8 ) ; for c in lit . chars ( ) { if let Some ( d ) = c . to_digit ( base ) { res = res * BigInt :: from ( base ) ; res = res + BigInt :: from ( d ) ; } else { let msg = format ! ( " " token_name c ) ; return Err ( self . err ( ErrorKind :: other ( msg ) ) ) ; } } Ok ( res ) }
Interpret the value of an int literal and return the result as a BigInt, using the provided
base.
Interpret the value of an int literal and return the result as a BigInt using the provided base .
&mut self
lit
&str
base
u32
token_name
&str