MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / lexical_import_scope

Function lexical_import_scope

internal/cbm/extract_usages.c:2072–2088  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2070}
2071
2072static uint32_t lexical_import_scope(const WalkState *state, uint32_t start_id) {
2073 uint32_t id = start_id;
2074 int remaining = state ? state->lexical_scope_count : 0;
2075 while (id != 0 && remaining-- > 0) {
2076 const CBMLexicalScope *scope = usage_lexical_scope(state, id);
2077 if (!scope) {
2078 return 0;
2079 }
2080 if (scope->kind == CBM_LEXICAL_SCOPE_MODULE || scope->kind == CBM_LEXICAL_SCOPE_FUNCTION ||
2081 scope->kind == CBM_LEXICAL_SCOPE_COMPREHENSION ||
2082 scope->kind == CBM_LEXICAL_SCOPE_BLOCK) {
2083 return id;
2084 }
2085 id = scope->parent_id;
2086 }
2087 return 0;
2088}
2089
2090static void record_lexical_binding(CBMExtractCtx *ctx, WalkState *state, TSNode node,
2091 const CBMLangSpec *spec, const char *raw_name,

Callers 1

record_lexical_bindingFunction · 0.85

Calls 1

usage_lexical_scopeFunction · 0.85

Tested by

no test coverage detected