get the arg of this call.
(node: &Node, arg_pos: usize)
| 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 { |
no test coverage detected