If the substring starting at the current position of the parser has the given prefix, then bump the parser to the character immediately following the prefix and return true. Otherwise, don't bump the parser and return false.
(&self, prefix: &str)
| 503 | /// following the prefix and return true. Otherwise, don't bump the parser |
| 504 | /// and return false. |
| 505 | fn bump_if(&self, prefix: &str) -> bool { |
| 506 | if self.pattern()[self.offset()..].starts_with(prefix) { |
| 507 | for _ in 0..prefix.chars().count() { |
| 508 | self.bump(); |
| 509 | } |
| 510 | true |
| 511 | } else { |
| 512 | false |
| 513 | } |
| 514 | } |
| 515 | |
| 516 | /// Returns true if and only if the parser is positioned at a look-around |
| 517 | /// prefix. The conditions under which this returns true must always |
no test coverage detected