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

Method span_char

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

Create a span that covers the current character.

(&self)

Source from the content-addressed store, hash-verified

632
633 /// Create a span that covers the current character.
634 fn span_char(&self) -> Span {
635 let mut next = Position {
636 offset: self.offset().checked_add(self.char().len_utf8()).unwrap(),
637 line: self.line(),
638 column: self.column().checked_add(1).unwrap(),
639 };
640 if self.char() == '\n' {
641 next.line += 1;
642 next.column = 1;
643 }
644 Span::new(self.pos(), next)
645 }
646
647 /// Parse and push a single alternation on to the parser's internal stack.
648 /// If the top of the stack already has an alternation, then add to that

Callers 13

pop_groupMethod · 0.80
parse_groupMethod · 0.80
parse_capture_nameMethod · 0.80
parse_flagsMethod · 0.80
parse_flagMethod · 0.80
parse_primitiveMethod · 0.80
parse_escapeMethod · 0.80
parse_hex_digitsMethod · 0.80
parse_hex_braceMethod · 0.80
parse_set_class_itemMethod · 0.80
parse_set_class_openMethod · 0.80
parse_unicode_classMethod · 0.80

Calls 7

unwrapMethod · 0.80
offsetMethod · 0.80
len_utf8Method · 0.80
lineMethod · 0.80
columnMethod · 0.80
charMethod · 0.45
posMethod · 0.45

Tested by

no test coverage detected