normalizeValue for cFamilySpec: bare identifiers, and the pointer_expression unwrap (`&fn`; `&Cls::m` keeps the qualified name).
(&mut self, v: Node<'t>, from: u32, mode: Mode, explicit_ref: bool, depth: u32)
| 2370 | /// normalizeValue for cFamilySpec: bare identifiers, and the |
| 2371 | /// pointer_expression unwrap (`&fn`; `&Cls::m` keeps the qualified name). |
| 2372 | fn normalize_fn_ref_value(&mut self, v: Node<'t>, from: u32, mode: Mode, explicit_ref: bool, depth: u32) { |
| 2373 | stack_guard!(); |
| 2374 | if depth > 4 { |
| 2375 | return; |
| 2376 | } |
| 2377 | match v.kind() { |
| 2378 | "identifier" => { |
| 2379 | let name = self.text(v); |
| 2380 | if name.is_empty() || is_stoplisted(name) { |
| 2381 | return; |
| 2382 | } |
| 2383 | self.push_fn_ref_cand(from, name.to_string(), mode, explicit_ref, v); |
| 2384 | } |
| 2385 | "pointer_expression" => { |
| 2386 | // `&x` is a function value; `*x` is a data read. |
| 2387 | if v.child(0).map(|c| c.kind() != "&").unwrap_or(true) { |
| 2388 | return; |
| 2389 | } |
| 2390 | let Some(inner) = v.child_by_field_name("argument") else { return }; |
| 2391 | if inner.kind() == "qualified_identifier" { |
| 2392 | let text = self.text(inner).trim(); |
| 2393 | if qualified_ref_re().is_match(text) && !is_stoplisted(text) { |
| 2394 | self.push_fn_ref_cand(from, text.to_string(), mode, explicit_ref, inner); |
| 2395 | } |
| 2396 | return; |
| 2397 | } |
| 2398 | self.normalize_fn_ref_value(inner, from, mode, explicit_ref, depth + 1); |
| 2399 | } |
| 2400 | _ => {} |
| 2401 | } |
| 2402 | } |
| 2403 | |
| 2404 | fn push_fn_ref_cand(&mut self, from: u32, name: String, mode: Mode, explicit_ref: bool, node: Node) { |
| 2405 | let p = node.start_position(); |
no test coverage detected