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

Method add

regex/regex-syntax/src/error.rs:196–207  ·  view source on GitHub ↗

Add the given span to this sequence, putting it in the right place.

(&mut self, span: ast::Span)

Source from the content-addressed store, hash-verified

194
195 /// Add the given span to this sequence, putting it in the right place.
196 fn add(&mut self, span: ast::Span) {
197 // This is grossly inefficient since we sort after each add, but right
198 // now, we only ever add two spans at most.
199 if span.is_one_line() {
200 let i = span.start.line - 1; // because lines are 1-indexed
201 self.by_line[i].push(span);
202 self.by_line[i].sort();
203 } else {
204 self.multi_line.push(span);
205 self.multi_line.sort();
206 }
207 }
208
209 /// Notate the pattern string with carents (`^`) pointing at each span
210 /// location. This only applies to spans that occur within a single line.

Callers 1

from_formatterMethod · 0.45

Calls 2

is_one_lineMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected