(&self, node: &'a Node)
| 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( |
no test coverage detected