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

Function span

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

Create a new span from the given offset range. This assumes a single line and sets the columns based on the offsets. i.e., This only works out of the box for ASCII, which is fine for most tests.

(range: Range<usize>)

Source from the content-addressed store, hash-verified

2341 /// line and sets the columns based on the offsets. i.e., This only works
2342 /// out of the box for ASCII, which is fine for most tests.
2343 fn span(range: Range<usize>) -> Span {
2344 let start = Position::new(range.start, 1, range.start + 1);
2345 let end = Position::new(range.end, 1, range.end + 1);
2346 Span::new(start, end)
2347 }
2348
2349 /// Create a new span for the corresponding byte range in the given string.
2350 fn span_range(subject: &str, range: Range<usize>) -> Span {

Callers 5

litFunction · 0.85
concatFunction · 0.85
altFunction · 0.85
groupFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected