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

Function lexical_import_scope

internal/cbm/extract_usages.c:2206–2222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2204}
2205
2206static uint32_t lexical_import_scope(const WalkState *state, uint32_t start_id) {
2207 uint32_t id = start_id;
2208 int remaining = state ? state->lexical_scope_count : 0;
2209 while (id != 0 && remaining-- > 0) {
2210 const CBMLexicalScope *scope = usage_lexical_scope(state, id);
2211 if (!scope) {
2212 return 0;
2213 }
2214 if (scope->kind == CBM_LEXICAL_SCOPE_MODULE || scope->kind == CBM_LEXICAL_SCOPE_FUNCTION ||
2215 scope->kind == CBM_LEXICAL_SCOPE_COMPREHENSION ||
2216 scope->kind == CBM_LEXICAL_SCOPE_BLOCK) {
2217 return id;
2218 }
2219 id = scope->parent_id;
2220 }
2221 return 0;
2222}
2223
2224static void record_lexical_binding(CBMExtractCtx *ctx, WalkState *state, TSNode node,
2225 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