pub fn parse_number<T: FromStr + Num>(input: &str) -> IResult<&str, T, RuleParseError<&str>> {
    let (input, token) = parse_token(input)?;
    let number = if token.starts_with("0x") || token.starts_with("0X") {
        T::from_str_radix(&token[2..], 16)
            .map_err(|_| Error(RuleParseError::NumberParseError(token.to_string())))?
    } else {
        token
            .parse::<T>()
            .map_err(|_| Error(RuleParseError::NumberParseError(token.to_string())))?
    };
    Ok((input, number))
}
/// Parser a number of type T.
Parser a number of type T.
Parser a number of type T .
pub fn parse_number<T: FromStr + Num>(input: &str) -> IResult<&str, T, RuleParseError<&str>> {
    let (input, token) = parse_token(input)?;
    let number = if token.starts_with("0x") || token.starts_with("0X") {
        T::from_str_radix(&token[2..], 16)
            .map_err(|_| Error(RuleParseError::NumberParseError(token.to_string())))?
    } else {
        token
            .parse::<T>()
            .map_err(|_| Error(RuleParseError::NumberParseError(token.to_string())))?
    };
    Ok((input, number))
}
pub fn parse_number < T : FromStr + Num > ( input : & str ) -> IResult < & str , T , RuleParseError < & str > > { let ( input , token ) = parse_token ( input ) ? ; let number = if token . starts_with ( " " ) || token . starts_with ( " " ) { T :: from_str_radix ( & token [ 2 .. ] , 16 ) . map_err ( | _ | Error ( RuleParseError :: NumberParseError ( token . to_string ( ) ) ) ) ? } else { token . parse :: < T > ( ) . map_err ( | _ | Error ( RuleParseError :: NumberParseError ( token . to_string ( ) ) ) ) ? } ; Ok ( ( input , number ) ) }
Parser a number of type T.
Parser a number of type T .
input
&str