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

Method bump

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

Bump the parser to the next Unicode scalar value. If the end of the input has been reached, then `false` is returned.

(&self)

Source from the content-addressed store, hash-verified

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

Callers 15

bump_ifMethod · 0.80
bump_and_bump_spaceMethod · 0.80
bump_spaceMethod · 0.80
push_alternateMethod · 0.80
pop_groupMethod · 0.80
pop_classMethod · 0.80
parse_groupMethod · 0.80
parse_capture_nameMethod · 0.80
parse_flagsMethod · 0.80
parse_primitiveMethod · 0.80

Calls 9

unwrapMethod · 0.80
len_utf8Method · 0.80
parserMethod · 0.80
offsetMethod · 0.80
is_eofMethod · 0.45
posMethod · 0.45
charMethod · 0.45
nextMethod · 0.45
patternMethod · 0.45

Tested by

no test coverage detected