Index and Field Assignment via Copy-on-Write Desugaring
5 sections
0%
Section 1 IndexSet trait + updated method + ARC copy-on-write Section 2 Parser — assignment_target grammar + AssignTarget AST node Section 3 Type-directed desugar + IndexSet resolution + validation + diagnostics Section 4 Spec + grammar.ebnf sync Section 5 Spec test corpus + dual-execution parity + error cases
Overview
Implement index and field assignment syntax (list[i] = x, state.name = x, mixed chains state.items[i] = x / list[i].name = x, nested grid[x][y][z] = v, compound list[i] += 1) as type-directed copy-on-write desugaring. list[i] = x desugars to list = list.updated(key: i, value: x) via the IndexSet trait; state.f = x desugars to state = { ...state, f: x } via struct spread. Under ARC at refcount==1 (the common local-binding case) the copy is optimized to in-place mutation. Root binding must be mutable (non-$, not a parameter, not a loop variable).
Planned
4 sections
Section 2 Not Started
Parser — assignment_target grammar + AssignTarget AST node
0/7 tasks
0/7 tasks
Section 3 Not Started
Type-directed desugar + IndexSet resolution + validation + diagnostics
0/8 tasks
0/8 tasks
Section 4 Not Started
Spec + grammar.ebnf sync
0/7 tasks
0/7 tasks
Section 5 Not Started
Spec test corpus + dual-execution parity + error cases
0/6 tasks
0/6 tasks