(&self, nested: &[&str])
| 377 | } |
| 378 | |
| 379 | pub fn find_nested_call(&self, nested: &[&str]) -> Option<(&CallExpr, &CallExpr, String)> { |
| 380 | let mut worklist = WorkList::new(); |
| 381 | worklist.push(&self.ast); |
| 382 | while !worklist.empty() { |
| 383 | let curr = worklist.pop(); |
| 384 | if let Clang::CallExpr(ce) = &curr.kind { |
| 385 | for arg in ce.get_childs(curr).iter() { |
| 386 | if let Clang::CallExpr(nested_call) = &arg.kind { |
| 387 | let nested_call_name = nested_call.get_name_as_string(arg); |
| 388 | if nested.contains(&nested_call_name.as_str()) { |
| 389 | return Some((ce, nested_call, nested_call_name)); |
| 390 | } |
| 391 | } |
| 392 | } |
| 393 | } |
| 394 | for child in &curr.inner { |
| 395 | worklist.push(child); |
| 396 | } |
| 397 | } |
| 398 | None |
| 399 | } |
| 400 | } |
| 401 | |
| 402 | pub mod utils { |
no test coverage detected