Lexical scope keeps unnamed-namespace barriers without naming their types.
(node, source: bytes)
| 5239 | |
| 5240 | |
| 5241 | def _cpp_lookup_scope(node, source: bytes) -> str: |
| 5242 | """Lexical scope keeps unnamed-namespace barriers without naming their types.""" |
| 5243 | parents = [] |
| 5244 | parent = node.parent |
| 5245 | while parent is not None: |
| 5246 | if parent.type in {"namespace_definition", "class_specifier", "struct_specifier"}: |
| 5247 | part = parent.child_by_field_name("name") |
| 5248 | if part is None and parent.type != "namespace_definition": |
| 5249 | return "" |
| 5250 | parents.append(_read_text(part, source) if part is not None else "(anonymous)") |
| 5251 | parent = parent.parent |
| 5252 | return "::".join(reversed(parents)) |
| 5253 | |
| 5254 | |
| 5255 | def _cpp_qualified_name(node, name: str, source: bytes) -> str: |
no test coverage detected