Phase 3a: spawn/record initializers use ':' (Rule A)

Comp = { f = v }  ->  Comp { f: v }. record() requires ':' and parse_spawn()
drops the '=' before the record; '=' is now assignment/binding only. Records
appear only in games, so the compiler seed is unaffected.

Migration: tools/ludic-tools/migrate_records.c (spawn-context aware). Verified
every golden byte-identical, old '=' form rejected, reseeded, test.sh 14/14.
Docs updated (LANGUAGE.md, BOOTSTRAP.md R2).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-08-27 15:58:00 +03:00
parent eac8f8f335
commit 39bd430ce8
12 changed files with 2499 additions and 2425 deletions

View file

@ -26,9 +26,9 @@ game Snake {
fn reset(x: int) -> int {
for (p, s) in query [Pos, Seg] { despawn self() }
spawn S0 { Seg = { order = 0 }; Pos = { x = 10, y = 7 } }
spawn S1 { Seg = { order = 1 }; Pos = { x = 9, y = 7 } }
spawn S2 { Seg = { order = 2 }; Pos = { x = 8, y = 7 } }
spawn S0 { Seg { order: 0 }; Pos { x: 10, y: 7 } }
spawn S1 { Seg { order: 1 }; Pos { x: 9, y: 7 } }
spawn S2 { Seg { order: 2 }; Pos { x: 8, y: 7 } }
setreg(R_DIR, 3)
setreg(R_LEN, 3)
setreg(R_TICK, 0)
@ -101,7 +101,7 @@ game Snake {
}
if reg(R_ATE) == 1 {
setreg(R_SCORE, reg(R_SCORE) + 1)
spawn Body { Seg = { order = len }; Pos = { x = reg(R_TX), y = reg(R_TY) } }
spawn Body { Seg { order: len }; Pos { x: reg(R_TX), y: reg(R_TY) } }
setreg(R_LEN, len + 1)
setreg(R_FX, rng_range(0, GW - 1))
setreg(R_FY, rng_range(0, GH - 1))