fn scan_hex_digits(&mut self,
                       n_digits: usize,
                       delim: char,
                       below_0x7f_only: bool)
                       -> bool {
        debug!("scanning {} digits until {:?}", n_digits, delim);
        let start_bpos = self.last_pos;
        let mut accum_int = 0;

        let mut valid = true;
        for _ in 0..n_digits {
            if self.is_eof() {
                let last_bpos = self.last_pos;
                self.fatal_span_(start_bpos, last_bpos, "unterminated numeric character escape");
            }
            if self.curr_is(delim) {
                let last_bpos = self.last_pos;
                self.err_span_(start_bpos, last_bpos, "numeric character escape is too short");
                valid = false;
                break;
            }
            let c = self.curr.unwrap_or('\x00');
            accum_int *= 16;
            accum_int += c.to_digit(16).unwrap_or_else(|| {
                self.err_span_char(self.last_pos, self.pos,
                              "illegal character in numeric character escape", c);

                valid = false;
                0
            });
            self.bump();
        }

        if below_0x7f_only && accum_int >= 0x80 {
            self.err_span_(start_bpos,
                           self.last_pos,
                           "this form of character escape may only be used \
                            with characters in the range [\\x00-\\x7f]");
            valid = false;
        }

        match char::from_u32(accum_int) {
            Some(_) => valid,
            None => {
                let last_bpos = self.last_pos;
                self.err_span_(start_bpos, last_bpos, "illegal numeric character escape");
                false
            }
        }
    }
/// Scan over `n_digits` hex digits, stopping at `delim`, reporting an
/// error if too many or too few digits are encountered.
Scan over `n_digits` hex digits, stopping at `delim`, reporting an
error if too many or too few digits are encountered.
Scan over ` n_digits ` hex digits stopping at ` delim ` reporting an error if too many or too few digits are encountered .
fn scan_hex_digits(&mut self,
                       n_digits: usize,
                       delim: char,
                       below_0x7f_only: bool)
                       -> bool {
        debug!("scanning {} digits until {:?}", n_digits, delim);
        let start_bpos = self.last_pos;
        let mut accum_int = 0;
        let mut valid = true;
        for _ in 0..n_digits {
            if self.is_eof() {
                let last_bpos = self.last_pos;
                self.fatal_span_(start_bpos, last_bpos, "unterminated numeric character escape");
            }
            if self.curr_is(delim) {
                let last_bpos = self.last_pos;
                self.err_span_(start_bpos, last_bpos, "numeric character escape is too short");
                valid = false;
                break;
            }
            let c = self.curr.unwrap_or('\x00');
            accum_int *= 16;
            accum_int += c.to_digit(16).unwrap_or_else(|| {
                self.err_span_char(self.last_pos, self.pos,
                              "illegal character in numeric character escape", c);
                valid = false;
                0
            });
            self.bump();
        }
        if below_0x7f_only && accum_int >= 0x80 {
            self.err_span_(start_bpos,
                           self.last_pos,
                           "this form of character escape may only be used \
                            with characters in the range [\\x00-\\x7f]");
            valid = false;
        }
        match char::from_u32(accum_int) {
            Some(_) => valid,
            None => {
                let last_bpos = self.last_pos;
                self.err_span_(start_bpos, last_bpos, "illegal numeric character escape");
                false
            }
        }
    }
fn scan_hex_digits ( & mut self , n_digits : usize , delim : char , below_0x7f_only : bool ) -> bool { debug ! ( " " n_digits delim ) ; let start_bpos = self . last_pos ; let mut accum_int = 0 ; let mut valid = true ; for _ in 0 .. n_digits { if self . is_eof ( ) { let last_bpos = self . last_pos ; self . fatal_span_ ( start_bpos , last_bpos , " " ) ; } if self . curr_is ( delim ) { let last_bpos = self . last_pos ; self . err_span_ ( start_bpos , last_bpos , " " ) ; valid = false ; break ; } let c = self . curr . unwrap_or ( '\x00' ) ; accum_int *= 16 ; accum_int += c . to_digit ( 16 ) . unwrap_or_else ( | | { self . err_span_char ( self . last_pos , self . pos , " " , c ) ; valid = false ; 0 } ) ; self . bump ( ) ; } if below_0x7f_only && accum_int >= 0x80 { self . err_span_ ( start_bpos , self . last_pos , " \
 \\ \\ " ) ; valid = false ; } match char :: from_u32 ( accum_int ) { Some ( _ ) => valid , None => { let last_bpos = self . last_pos ; self . err_span_ ( start_bpos , last_bpos , " " ) ; false } } }
Scan over `n_digits` hex digits, stopping at `delim`, reporting an
error if too many or too few digits are encountered.
Scan over ` n_digits ` hex digits stopping at ` delim ` reporting an error if too many or too few digits are encountered .
&mut self
n_digits
usize
delim
char
below_0x7f_only
bool