(&self, var_name: &str)
| 145 | } |
| 146 | |
| 147 | pub fn find_binary_operator(&self, var_name: &str) -> Option<&Node> { |
| 148 | let mut worklist = WorkList::new(); |
| 149 | worklist.push(&self.ast); |
| 150 | while !worklist.empty() { |
| 151 | let curr = worklist.pop(); |
| 152 | if let Clang::BinaryOperator(bo) = &curr.kind { |
| 153 | let left = bo.get_lhs(curr); |
| 154 | if let Clang::DeclRefExpr(dre) = &left.kind { |
| 155 | let name = dre.get_name_as_string(); |
| 156 | if var_name == name { |
| 157 | let right = bo.get_rhs(curr); |
| 158 | return Some(right); |
| 159 | } |
| 160 | } |
| 161 | } |
| 162 | worklist.push_childs(curr.get_childs()); |
| 163 | } |
| 164 | None |
| 165 | } |
| 166 | |
| 167 | pub fn visit_nth_library_call(&self, nth: usize) -> &Node { |
| 168 | let calls = self.visit_library_calls(); |
no test coverage detected