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

Method find_api_call_with_arg

src/ast/visitor.rs:340–353  ·  view source on GitHub ↗
(&self, arg_name: &str)

Source from the content-addressed store, hash-verified

338 }
339
340 pub fn find_api_call_with_arg(&self, arg_name: &str) -> Option<&Node> {
341 let calls = self.visit_library_calls();
342 for call in calls {
343 for arg in call.get_childs() {
344 if let Clang::DeclRefExpr(dre) = &arg.kind {
345 let name = dre.get_name_as_string();
346 if arg_name == name {
347 return Some(call);
348 }
349 }
350 }
351 }
352 None
353 }
354
355 pub fn match_string_pattern(&self, patten: regex::Regex) -> Option<String> {
356 let mut work_list = WorkList::new();

Callers

nothing calls this directly

Calls 3

visit_library_callsMethod · 0.80
get_name_as_stringMethod · 0.80
get_childsMethod · 0.45

Tested by

no test coverage detected