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

Function get_source_code_range

src/ast/loc.rs:162–168  ·  view source on GitHub ↗
(sr: &SourceRange)

Source from the content-addressed store, hash-verified

160}
161
162pub fn get_source_code_range(sr: &SourceRange) -> Result<(usize, usize)> {
163 let begin = get_sr_begin_loc(sr)?;
164 let end = get_sr_end_loc(sr)?;
165 let begin_loc = begin.offset;
166 let end_loc = end.offset + end.tok_len;
167 Ok((begin_loc, end_loc))
168}
169
170pub fn get_header_code_range(sr: &SourceRange) -> Result<(usize, usize)> {
171 let begin = sr.begin.spelling_loc.as_ref().unwrap();

Callers 3

get_source_code_contentFunction · 0.85
get_source_rangeMethod · 0.85

Calls 2

get_sr_begin_locFunction · 0.85
get_sr_end_locFunction · 0.85

Tested by

no test coverage detected