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

Method get_childs

src/program/array.rs:30–45  ·  view source on GitHub ↗
(&self, node: &'a Node)

Source from the content-addressed store, hash-verified

28 }
29
30 pub fn get_childs<'a>(&self, node: &'a Node) -> Vec<&'a Node> {
31 let mut childs: Vec<&Node> = Vec::new();
32 for child in &node.inner {
33 let child = child.ignore_cast().ignore_parent();
34 match &child.kind {
35 Clang::StringLiteral(_)
36 | Clang::CharacterLiteral(_)
37 | Clang::FloatingLiteral(_)
38 | Clang::IntegerLiteral(_)
39 | Clang::InitListExpr(_) => childs.push(child),
40 Clang::UnaryOperator(_) => childs.push(child.get_child().ignore_cast()),
41 _ => unimplemented!("{child:?} is unimplemented for InitListExpr::get_childs."),
42 }
43 }
44 childs
45 }
46
47 /// get the char * array declared in InitListExpr, e.g., char *[] = {"hello", "world"}
48 pub fn get_char_star_array_literal(

Callers 5

is_read_from_fileFunction · 0.45
is_ret_by_callFunction · 0.45
is_alloc_size_of_varFunction · 0.45
is_strlen_of_varFunction · 0.45

Calls 4

ignore_parentMethod · 0.80
ignore_castMethod · 0.80
get_childMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected