| 1392 | } |
| 1393 | |
| 1394 | static 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 |
no test coverage detected