MCPcopy Create free account
hub / github.com/davidblewett/rure-python / bump_if

Method bump_if

regex/regex-syntax/src/ast/parse.rs:505–514  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 3

is_lookaround_prefixMethod · 0.80
parse_groupMethod · 0.80

Calls 4

offsetMethod · 0.80
countMethod · 0.80
bumpMethod · 0.80
patternMethod · 0.45

Tested by

no test coverage detected