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)
| 1690 | /// normalizeValue for cFamilySpec: bare identifiers, and the |
| 1691 | /// pointer_expression unwrap (`&fn`; `&Cls::m` keeps the qualified name). |
| 1692 | fn normalize_fn_ref_value(&mut self, v: Node<'t>, from: u32, mode: Mode, explicit_ref: bool, depth: u32) { |
| 1693 | if depth > 4 { |
| 1694 | return; |
| 1695 | } |
| 1696 | match v.kind() { |
| 1697 | "identifier" => { |
| 1698 | let name = self.text(v); |
| 1699 | if name.is_empty() || is_stoplisted(name) { |
| 1700 | return; |
| 1701 | } |
| 1702 | self.push_fn_ref_cand(from, name.to_string(), mode, explicit_ref, v); |
| 1703 | } |
| 1704 | "pointer_expression" => { |
| 1705 | // `&x` is a function value; `*x` is a data read. |
| 1706 | if v.child(0).map(|c| c.kind() != "&").unwrap_or(true) { |
| 1707 | return; |
| 1708 | } |
| 1709 | let Some(inner) = v.child_by_field_name("argument") else { return }; |
| 1710 | if inner.kind() == "qualified_identifier" { |
| 1711 | let text = self.text(inner).trim(); |
| 1712 | if qualified_ref_re().is_match(text) && !is_stoplisted(text) { |
| 1713 | self.push_fn_ref_cand(from, text.to_string(), mode, explicit_ref, inner); |
| 1714 | } |
| 1715 | return; |
| 1716 | } |
| 1717 | self.normalize_fn_ref_value(inner, from, mode, explicit_ref, depth + 1); |
| 1718 | } |
| 1719 | _ => {} |
| 1720 | } |
| 1721 | } |
| 1722 | |
| 1723 | fn push_fn_ref_cand(&mut self, from: u32, name: String, mode: Mode, explicit_ref: bool, node: Node) { |
| 1724 | let p = node.start_position(); |
no test coverage detected