Get the source file offsets of this range.
(sr: &SourceRange)
| 44 | |
| 45 | /// Get the source file offsets of this range. |
| 46 | pub fn get_sr_offset(sr: &SourceRange) -> Result<(usize, usize)> { |
| 47 | let begin = get_sr_begin_loc(sr)?.offset; |
| 48 | let end = get_sr_end_loc(sr)?; |
| 49 | let end = end.offset + end.tok_len; |
| 50 | Ok((begin, end)) |
| 51 | } |
| 52 | |
| 53 | /// Get the beginning offset of the previous one VarDecl; |
| 54 | fn get_pre_vd_begin(vd_begin: &BareSourceLocation, src_file: &Path) -> Result<usize> { |
no test coverage detected