MCPcopy Create free account
hub / github.com/FuzzAnything/PromptFuzz / get_sr_end_loc

Function get_sr_end_loc

src/ast/loc.rs:31–43  ·  view source on GitHub ↗

Get the end location of this range.

(sr: &SourceRange)

Source from the content-addressed store, hash-verified

29
30/// Get the end location of this range.
31pub fn get_sr_end_loc(sr: &SourceRange) -> Result<&BareSourceLocation> {
32 if let Some(end) = &sr.end.spelling_loc {
33 if end.file.ends_with(".cc") {
34 return Ok(end);
35 }
36 }
37 if let Some(end) = &sr.end.expansion_loc {
38 if end.file.ends_with(".cc") {
39 return Ok(end);
40 }
41 }
42 eyre::bail!("cannot get end from SourceRange: {sr:?}")
43}
44
45/// Get the source file offsets of this range.
46pub fn get_sr_offset(sr: &SourceRange) -> Result<(usize, usize)> {

Callers 6

get_sr_offsetFunction · 0.85
get_var_uninit_locFunction · 0.85
get_source_code_rangeFunction · 0.85
get_fd_param_locMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected