Get the bigin location of this range.
(sr: &SourceRange)
| 14 | |
| 15 | /// Get the bigin location of this range. |
| 16 | pub fn get_sr_begin_loc(sr: &SourceRange) -> Result<&BareSourceLocation> { |
| 17 | if let Some(begin) = &sr.begin.spelling_loc { |
| 18 | if begin.file.ends_with(".cc") { |
| 19 | return Ok(begin); |
| 20 | } |
| 21 | } |
| 22 | if let Some(begin) = &sr.begin.expansion_loc { |
| 23 | if begin.file.ends_with(".cc") { |
| 24 | return Ok(begin); |
| 25 | } |
| 26 | } |
| 27 | eyre::bail!("cannot get begin from SourceRange: {sr:?}") |
| 28 | } |
| 29 | |
| 30 | /// Get the end location of this range. |
| 31 | pub fn get_sr_end_loc(sr: &SourceRange) -> Result<&BareSourceLocation> { |
no outgoing calls
no test coverage detected