(&mut self, o: u8)
| 185 | } |
| 186 | |
| 187 | fn parse_octet(&mut self, o: u8) -> char { |
| 188 | let mut radix_bytes = [o, 0, 0]; |
| 189 | let mut len = 1; |
| 190 | |
| 191 | while len < 3 { |
| 192 | let Some(b'0'..=b'7') = self.peek_byte() else { |
| 193 | break; |
| 194 | }; |
| 195 | |
| 196 | radix_bytes[len] = self.next_byte().unwrap(); |
| 197 | len += 1; |
| 198 | } |
| 199 | |
| 200 | // OK because radix_bytes is always going to be in the ASCII range. |
| 201 | let radix_str = std::str::from_utf8(&radix_bytes[..len]).expect("ASCII bytes"); |
| 202 | let value = u32::from_str_radix(radix_str, 8).unwrap(); |
| 203 | char::from_u32(value).unwrap() |
| 204 | } |
| 205 | |
| 206 | fn parse_unicode_name(&mut self) -> Result<char, LexicalError> { |
| 207 | let start_pos = self.position(); |
no test coverage detected