MCPcopy Create free account
hub / github.com/Graphify-Labs/graphify / _cpp_lookup_scope

Function _cpp_lookup_scope

graphify/extractors/engine.py:5241–5252  ·  view source on GitHub ↗

Lexical scope keeps unnamed-namespace barriers without naming their types.

(node, source: bytes)

Source from the content-addressed store, hash-verified

5239
5240
5241def _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
5255def _cpp_qualified_name(node, name: str, source: bytes) -> str:

Callers 3

_cpp_resolution_factsFunction · 0.85
walk_callsFunction · 0.85

Calls 2

_read_textFunction · 0.90
joinMethod · 0.45

Tested by

no test coverage detected