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

Function get_nth_arg

src/ast/visitor.rs:477–484  ·  view source on GitHub ↗

get the arg of this call.

(node: &Node, arg_pos: usize)

Source from the content-addressed store, hash-verified

475
476 /// get the arg of this call.
477 pub fn get_nth_arg(node: &Node, arg_pos: usize) -> Result<&Node> {
478 if let Clang::CallExpr(_ce) = &node.kind {
479 if let Some(arg) = node.inner.get(arg_pos + 1) {
480 return Ok(arg.ignore_cast().ignore_parent());
481 }
482 }
483 eyre::bail!("{node:#?} needs to be a CallExpr")
484 }
485
486 pub fn get_arg_ref(arg: &Node) -> Option<String> {
487 if let Clang::DeclRefExpr(dre) = &arg.kind {

Calls 2

ignore_parentMethod · 0.80
ignore_castMethod · 0.80

Tested by

no test coverage detected