incr.comp.: Store Spans as (file,line,col,length) in incr.comp. cache.
The previous method ran into problems because ICH would treat Spans as (file,line,col) but the cache contained byte offsets and its possible for the latter to change while the former stayed stable.
This commit is contained in:
parent
409e39285d
commit
45439945c9
4 changed files with 178 additions and 114 deletions
|
@ -931,6 +931,11 @@ impl FileMap {
|
|||
(lines[line_index], lines[line_index + 1])
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn contains(&self, byte_pos: BytePos) -> bool {
|
||||
byte_pos >= self.start_pos && byte_pos <= self.end_pos
|
||||
}
|
||||
}
|
||||
|
||||
/// Remove utf-8 BOM if any.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue