| 1597 | } |
| 1598 | |
| 1599 | static void cs_process_assignment(CSLSPContext *ctx, TSNode node) { |
| 1600 | TSNode lhs = ts_node_child_by_field_name(node, "left", 4); |
| 1601 | TSNode rhs = ts_node_child_by_field_name(node, "right", 5); |
| 1602 | if (ts_node_is_null(lhs) || ts_node_is_null(rhs)) return; |
| 1603 | if (!cs_node_is(lhs, "identifier")) return; |
| 1604 | char *vname = cs_node_text(ctx, lhs); |
| 1605 | if (!vname) return; |
| 1606 | const char *callable_qn = cs_resolve_callable_value(ctx, rhs, NULL); |
| 1607 | (void)cs_eval_expr_type(ctx, rhs); |
| 1608 | if (callable_qn) { |
| 1609 | cbm_scope_update_callable(ctx->current_scope, vname, callable_qn); |
| 1610 | } else { |
| 1611 | /* An ordinary or ambiguous reassignment clears stale callable identity |
| 1612 | * while retaining the best type already known for the variable. */ |
| 1613 | cbm_scope_update_callable(ctx->current_scope, vname, NULL); |
| 1614 | } |
| 1615 | } |
| 1616 | |
| 1617 | /* ── call resolution + emit ─────────────────────────────────────── */ |
| 1618 |
no test coverage detected