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

Function cbm_scope_bind

internal/cbm/lsp/scope.c:36–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36void cbm_scope_bind(CBMScope* scope, const char* name, const CBMType* type) {
37 if (!scope || !name) {
38 return;
39 }
40 for (CBMScopeChunk* c = scope->chunks; c != NULL; c = c->next) {
41 for (int i = 0; i < c->used; i++) {
42 if (c->bindings[i].name && strcmp(c->bindings[i].name, name) == 0) {
43 c->bindings[i].type = type;
44 return;
45 }
46 }
47 }
48 CBMScopeChunk* head = scope->chunks;
49 if (!head || head->used >= CBM_SCOPE_CHUNK_BINDINGS) {
50 head = alloc_chunk(scope);
51 if (!head) {
52 return;
53 }
54 }
55 head->bindings[head->used].name = name;
56 head->bindings[head->used].type = type;
57 head->used++;
58}
59
60const CBMType* cbm_scope_lookup(const CBMScope* scope, const char* name) {
61 if (!name) {

Callers 15

parse_phpdoc_for_paramsFunction · 0.85
bind_phpdoc_varFunction · 0.85
process_assignmentFunction · 0.85
process_foreachFunction · 0.85
process_catchFunction · 0.85
apply_assert_narrowingFunction · 0.85
walk_with_narrowingsFunction · 0.85
process_if_statementFunction · 0.85
bind_typed_parametersFunction · 0.85
process_function_likeFunction · 0.85
py_scope_bindFunction · 0.85
c_process_statementFunction · 0.85

Calls 1

alloc_chunkFunction · 0.85

Tested by

no test coverage detected