| 1807 | } |
| 1808 | |
| 1809 | static void cs_process_assignment(CSLSPContext *ctx, TSNode node) { |
| 1810 | TSNode lhs = ts_node_child_by_field_name(node, "left", 4); |
| 1811 | TSNode rhs = ts_node_child_by_field_name(node, "right", 5); |
| 1812 | if (ts_node_is_null(lhs) || ts_node_is_null(rhs)) |
| 1813 | return; |
| 1814 | if (!cs_node_is(lhs, "identifier")) |
| 1815 | return; |
| 1816 | char *vname = cs_node_text(ctx, lhs); |
| 1817 | if (!vname) |
| 1818 | return; |
| 1819 | const char *callable_qn = cs_resolve_callable_value(ctx, rhs, NULL); |
| 1820 | (void)cs_eval_expr_type(ctx, rhs); |
| 1821 | if (callable_qn) { |
| 1822 | cbm_scope_update_callable(ctx->current_scope, vname, callable_qn); |
| 1823 | } else { |
| 1824 | /* An ordinary or ambiguous reassignment clears stale callable identity |
| 1825 | * while retaining the best type already known for the variable. */ |
| 1826 | cbm_scope_update_callable(ctx->current_scope, vname, NULL); |
| 1827 | } |
| 1828 | } |
| 1829 | |
| 1830 | /* ── call resolution + emit ─────────────────────────────────────── */ |
| 1831 |
no test coverage detected