Bump the parser to the next Unicode scalar value. If the end of the input has been reached, then `false` is returned.
(&self)
| 479 | /// |
| 480 | /// If the end of the input has been reached, then `false` is returned. |
| 481 | fn bump(&self) -> bool { |
| 482 | if self.is_eof() { |
| 483 | return false; |
| 484 | } |
| 485 | let Position { mut offset, mut line, mut column } = self.pos(); |
| 486 | if self.char() == '\n' { |
| 487 | line = line.checked_add(1).unwrap(); |
| 488 | column = 1; |
| 489 | } else { |
| 490 | column = column.checked_add(1).unwrap(); |
| 491 | } |
| 492 | offset += self.char().len_utf8(); |
| 493 | self.parser().pos.set(Position { |
| 494 | offset: offset, |
| 495 | line: line, |
| 496 | column: column, |
| 497 | }); |
| 498 | self.pattern()[self.offset()..].chars().next().is_some() |
| 499 | } |
| 500 | |
| 501 | /// If the substring starting at the current position of the parser has |
| 502 | /// the given prefix, then bump the parser to the character immediately |
no test coverage detected