fn accept_prefix_r(&mut self, l: &mut Lexer) -> Result<u8, &'static str> {
        // we expect either exactness, radix, or both, in any order;
        // however, if we see more than one of either, that's an error
        let mut base_set = 0;
        let mut exactness_set = 0;
        while l.accept("#") {
            if let Some(ch) = l.next() {
                match ch {
                    'd' | 'D' => {
                        base_set += 1;
                    }
                    'b' | 'B' => {
                        base_set += 1;
                        self.digits = "01".to_string();
                    }
                    'o' | 'O' => {
                        base_set += 1;
                        self.digits = "01234567".to_string();
                    }
                    'x' | 'X' => {
                        base_set += 1;
                        self.digits = "0123456789abcdefABCDEF".to_string();
                    }
                    'e' | 'E' => {
                        exactness_set += 1;
                    }
                    'i' | 'I' => {
                        exactness_set += 1;
                    }
                    _ => {
                        // unrecognized letter, signal an error
                        base_set = 10;
                    }
                }
            }
        }
        if base_set > 1 || exactness_set > 1 {
            return Err("malformed number prefix");
        }
        Ok(0)
    }
/// `accept_prefix_r` attempts to read the prefix to a numeric literal.
`accept_prefix_r` attempts to read the prefix to a numeric literal.
` accept_prefix_r ` attempts to read the prefix to a numeric literal .
fn accept_prefix_r(&mut self, l: &mut Lexer) -> Result<u8, &'static str> {
        // we expect either exactness, radix, or both, in any order;
        // however, if we see more than one of either, that's an error
        let mut base_set = 0;
        let mut exactness_set = 0;
        while l.accept("#") {
            if let Some(ch) = l.next() {
                match ch {
                    'd' | 'D' => {
                        base_set += 1;
                    }
                    'b' | 'B' => {
                        base_set += 1;
                        self.digits = "01".to_string();
                    }
                    'o' | 'O' => {
                        base_set += 1;
                        self.digits = "01234567".to_string();
                    }
                    'x' | 'X' => {
                        base_set += 1;
                        self.digits = "0123456789abcdefABCDEF".to_string();
                    }
                    'e' | 'E' => {
                        exactness_set += 1;
                    }
                    'i' | 'I' => {
                        exactness_set += 1;
                    }
                    _ => {
                        // unrecognized letter, signal an error
                        base_set = 10;
                    }
                }
            }
        }
        if base_set > 1 || exactness_set > 1 {
            return Err("malformed number prefix");
        }
        Ok(0)
    }
fn accept_prefix_r ( & mut self , l : & mut Lexer ) -> Result < u8 , & ' static str > { // we expect either exactness, radix, or both, in any order; // however, if we see more than one of either, that's an error let mut base_set = 0 ; let mut exactness_set = 0 ; while l . accept ( " " ) { if let Some ( ch ) = l . next ( ) { match ch { 'd' | 'D' => { base_set += 1 ; } 'b' | 'B' => { base_set += 1 ; self . digits = " " . to_string ( ) ; } 'o' | 'O' => { base_set += 1 ; self . digits = " " . to_string ( ) ; } 'x' | 'X' => { base_set += 1 ; self . digits = " " . to_string ( ) ; } 'e' | 'E' => { exactness_set += 1 ; } 'i' | 'I' => { exactness_set += 1 ; } _ => { // unrecognized letter, signal an error base_set = 10 ; } } } } if base_set > 1 || exactness_set > 1 { return Err ( " " ) ; } Ok ( 0 ) }
`accept_prefix_r` attempts to read the prefix to a numeric literal.
` accept_prefix_r ` attempts to read the prefix to a numeric literal .
&mut self
l
&mut Lexer