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

Function lexical_import_scope

internal/cbm/extract_usages.c:2102–2118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2100}
2101
2102static uint32_t lexical_import_scope(const WalkState *state, uint32_t start_id) {
2103 uint32_t id = start_id;
2104 int remaining = state ? state->lexical_scope_count : 0;
2105 while (id != 0 && remaining-- > 0) {
2106 const CBMLexicalScope *scope = usage_lexical_scope(state, id);
2107 if (!scope) {
2108 return 0;
2109 }
2110 if (scope->kind == CBM_LEXICAL_SCOPE_MODULE || scope->kind == CBM_LEXICAL_SCOPE_FUNCTION ||
2111 scope->kind == CBM_LEXICAL_SCOPE_COMPREHENSION ||
2112 scope->kind == CBM_LEXICAL_SCOPE_BLOCK) {
2113 return id;
2114 }
2115 id = scope->parent_id;
2116 }
2117 return 0;
2118}
2119
2120static void record_lexical_binding(CBMExtractCtx *ctx, WalkState *state, TSNode node,
2121 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