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

Function lexical_binding_active_at

internal/cbm/extract_usages.c:2265–2283  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2263}
2264
2265static bool lexical_binding_active_at(const WalkState *state, uint32_t scope_id, const char *name,
2266 uint32_t position) {
2267 const CBMLexicalScope *scope = usage_lexical_scope(state, scope_id);
2268 if (!scope) {
2269 return false;
2270 }
2271 int index = lexical_binding_lower_bound(state, scope_id, name);
2272 while (index < state->lexical_binding_count) {
2273 const CBMLexicalBinding *binding = &state->lexical_bindings[index++];
2274 if (binding->scope_id != scope_id || strcmp(binding->name, name) != 0) {
2275 break;
2276 }
2277 uint32_t active_end = binding->active_end ? binding->active_end : scope->end_byte;
2278 if (binding->active_start <= position && position < active_end) {
2279 return true;
2280 }
2281 }
2282 return false;
2283}
2284
2285static const CBMLexicalScope *lexical_binding_scope_for_usage(const WalkState *state,
2286 const CBMUsage *usage,

Callers 1

Calls 2

usage_lexical_scopeFunction · 0.85

Tested by

no test coverage detected