find and highlight the &
or '_
in region_name
This commit is contained in:
parent
9fd3d7899a
commit
a6adb1ebff
7 changed files with 300 additions and 22 deletions
|
@ -689,6 +689,15 @@ impl CodeMap {
|
|||
self.span_until_char(sp, '{')
|
||||
}
|
||||
|
||||
/// Returns a new span representing just the start-point of this span
|
||||
pub fn start_point(&self, sp: Span) -> Span {
|
||||
let pos = sp.lo().0;
|
||||
let width = self.find_width_of_character_at_span(sp, false);
|
||||
let corrected_start_position = pos.checked_add(width).unwrap_or(pos);
|
||||
let end_point = BytePos(cmp::max(corrected_start_position, sp.lo().0));
|
||||
sp.with_hi(end_point)
|
||||
}
|
||||
|
||||
/// Returns a new span representing just the end-point of this span
|
||||
pub fn end_point(&self, sp: Span) -> Span {
|
||||
let pos = sp.hi().0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue