(&self, n: u8, skip: KindSet)
| 291 | |
| 292 | #[inline] |
| 293 | pub(crate) fn peek_n_with_skip(&self, n: u8, skip: KindSet) -> Cursor { |
| 294 | let mut remaining = n; |
| 295 | |
| 296 | for c in &self.buffer[self.buffer_index..BUFFER_LEN] { |
| 297 | if c == Kind::Eof { |
| 298 | return *c; |
| 299 | } |
| 300 | if c != skip { |
| 301 | remaining -= 1; |
| 302 | if remaining == 0 { |
| 303 | return *c; |
| 304 | } |
| 305 | } |
| 306 | } |
| 307 | |
| 308 | let mut iter = self.cursor_iter.clone(); |
| 309 | loop { |
| 310 | let Some(cursor) = iter.next() else { |
| 311 | return eof_cursor(self.source_text.len()); |
| 312 | }; |
| 313 | if cursor == Kind::Eof { |
| 314 | return cursor; |
| 315 | } |
| 316 | if cursor != skip { |
| 317 | remaining -= 1; |
| 318 | if remaining == 0 { |
| 319 | return cursor; |
| 320 | } |
| 321 | } |
| 322 | } |
| 323 | } |
| 324 | |
| 325 | #[inline] |
| 326 | pub fn peek_n(&self, n: u8) -> Cursor { |
no test coverage detected