(&mut self, o: u8)
| 83 | } |
| 84 | |
| 85 | fn parse_octet(&mut self, o: u8) -> char { |
| 86 | let mut radix_bytes = [o, 0, 0]; |
| 87 | let mut len = 1; |
| 88 | |
| 89 | while len < 3 { |
| 90 | let Some(b'0'..=b'7') = self.peek_byte() else { |
| 91 | break; |
| 92 | }; |
| 93 | |
| 94 | radix_bytes[len] = self.next_byte().unwrap(); |
| 95 | len += 1; |
| 96 | } |
| 97 | |
| 98 | // OK because radix_bytes is always going to be in the ASCII range. |
| 99 | let radix_str = core::str::from_utf8(&radix_bytes[..len]).expect("ASCII bytes"); |
| 100 | let value = u32::from_str_radix(radix_str, 8).unwrap(); |
| 101 | char::from_u32(value).unwrap() |
| 102 | } |
| 103 | |
| 104 | fn parse_unicode_name(&mut self) -> Result<char, LexicalError> { |
| 105 | let Some('{') = self.next_char() else { |
no test coverage detected