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

Function cs_process_assignment

internal/cbm/lsp/cs_lsp.c:1394–1407  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1392}
1393
1394static void cs_process_assignment(CSLSPContext *ctx, TSNode node) {
1395 TSNode lhs = ts_node_child_by_field_name(node, "left", 4);
1396 TSNode rhs = ts_node_child_by_field_name(node, "right", 5);
1397 if (ts_node_is_null(lhs) || ts_node_is_null(rhs)) return;
1398 if (!cs_node_is(lhs, "identifier")) return;
1399 char *vname = cs_node_text(ctx, lhs);
1400 if (!vname) return;
1401 const CBMType *t = cs_eval_expr_type(ctx, rhs);
1402 if (!t || t->kind == CBM_TYPE_UNKNOWN) return;
1403 /* Don't override more-specific bindings with weaker ones. */
1404 const CBMType *existing = cbm_scope_lookup(ctx->current_scope, vname);
1405 if (existing && existing->kind == CBM_TYPE_NAMED && t->kind == CBM_TYPE_UNKNOWN) return;
1406 cbm_scope_bind(ctx->current_scope, vname, t);
1407}
1408
1409/* ── call resolution + emit ─────────────────────────────────────── */
1410

Callers 1

cs_resolve_calls_in_nodeFunction · 0.85

Calls 5

cs_node_isFunction · 0.85
cs_node_textFunction · 0.85
cs_eval_expr_typeFunction · 0.85
cbm_scope_lookupFunction · 0.85
cbm_scope_bindFunction · 0.85

Tested by

no test coverage detected