Return the bare variable name from a C++ declaration declarator, unwrapping pointer/reference/init wrappers (``*f``, ``&r``, ``f = Foo()``). Returns None for anything that isn't a plain named local (arrays, function pointers, structured bindings) so the type table never records a guessed
(node, source: bytes)
| 5139 | return None |
| 5140 | |
| 5141 | def _cpp_declarator_name(node, source: bytes) -> str | None: |
| 5142 | """Return the bare variable name from a C++ declaration declarator, unwrapping |
| 5143 | pointer/reference/init wrappers (``*f``, ``&r``, ``f = Foo()``). Returns None |
| 5144 | for anything that isn't a plain named local (arrays, function pointers, |
| 5145 | structured bindings) so the type table never records a guessed receiver.""" |
| 5146 | t = node.type |
| 5147 | if t in ("identifier", "field_identifier"): |
| 5148 | return _read_text(node, source) |
| 5149 | if t in ("pointer_declarator", "reference_declarator", "init_declarator"): |
| 5150 | inner = node.child_by_field_name("declarator") |
| 5151 | if inner is None: |
| 5152 | for c in node.children: |
| 5153 | if c.type in ("identifier", "field_identifier", |
| 5154 | "pointer_declarator", "reference_declarator"): |
| 5155 | inner = c |
| 5156 | break |
| 5157 | if inner is not None: |
| 5158 | return _cpp_declarator_name(inner, source) |
| 5159 | return None |
| 5160 | |
| 5161 | def _cpp_parameter_types(body_node, source: bytes, table: dict[str, str]) -> None: |
| 5162 | """Collect ``param -> ClassName`` from the enclosing function's parameter |
no test coverage detected