Skip to content

Commit e8bb327

Browse files
hyperpolymathclaude
andcommitted
feat(#218)!: complete Rust-like record migration — 257/257 green
Migrated the remaining expression-position record literals to #{ } (compiler-as-oracle, iterated to green): - test/e2e/fixtures/counter.affine (tea_run arg record) - test/e2e/fixtures/full_pipeline.affine (fn-return + Rect(#{}) arg) - test/e2e/fixtures/titlescreen.affine (title_init body + 4 match-arm records + tea_run arg) - examples/comprehensive_test.affine (fn-return + Rect(#{}) arg) - stdlib/testing.affine (benchmark-result record — the ONE stdlib record literal; earlier survey missed it, parse-gated) Type-position records, struct/type declarations, blocks, and match-arm blocks left unchanged (different grammar rules — verified). Full dune gate now GREEN: 257/257, 0 failures. Conflicts 72->68 S/R, 10->7 R/R (residual families tracked on #215). Breaking syntax change — review-gated, do not auto-merge. Refs #218 #215 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 3ccb4d8 commit e8bb327

5 files changed

Lines changed: 12 additions & 12 deletions

File tree

examples/comprehensive_test.affine

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ enum Shape {
1212
}
1313

1414
fn vec2_add(a: Vec2, b: Vec2) -> Vec2 {
15-
{ x: a.x + b.x, y: a.y + b.y }
15+
#{ x: a.x + b.x, y: a.y + b.y }
1616
}
1717

1818
fn area(s: Shape) -> Int {
@@ -30,7 +30,7 @@ fn larger_area(s1: Shape, s2: Shape) -> Int = max(area(s1), area(s2));
3030

3131
fn main() -> () {
3232
let circle = Circle(5);
33-
let rect = Rect({ x: 3, y: 4 });
33+
let rect = Rect(#{ x: 3, y: 4 });
3434
let result = larger_area(circle, rect);
3535
();
3636
}

stdlib/testing.affine

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ fn bench(f: () -> (), iterations: Int) -> BenchResult {
303303
}
304304

305305
let tot = time_now() - start;
306-
{
306+
#{
307307
iterations: iterations,
308308
total_time: tot,
309309
avg_time: tot / float(iterations)

test/e2e/fixtures/counter.affine

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ fn counter_subs(model: Int) -> String {
6868
// Wire up the TEA runtime and hand off to the interpreter loop.
6969

7070
fn main() -> () {
71-
tea_run({
71+
tea_run(#{
7272
init: counter_init,
7373
update: counter_update,
7474
view: counter_view,

test/e2e/fixtures/full_pipeline.affine

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ enum Shape {
1313
}
1414

1515
fn vec2_add(a: Vec2, b: Vec2) -> Vec2 {
16-
{ x: a.x + b.x, y: a.y + b.y }
16+
#{ x: a.x + b.x, y: a.y + b.y }
1717
}
1818

1919
fn area(s: Shape) -> Int {
@@ -31,7 +31,7 @@ fn larger_area(s1: Shape, s2: Shape) -> Int = max(area(s1), area(s2));
3131

3232
fn main() -> () {
3333
let circle = Circle(5);
34-
let rect = Rect({ x: 3, y: 4 });
34+
let rect = Rect(#{ x: 3, y: 4 });
3535
let result = larger_area(circle, rect);
3636
();
3737
}

test/e2e/fixtures/titlescreen.affine

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ struct TitleModel {
4444
// ── init ─────────────────────────────────────────────────────────────────────
4545

4646
fn title_init() -> TitleModel {
47-
{
47+
#{
4848
screen_w: 1280,
4949
screen_h: 720,
5050
bgm_playing: 0,
@@ -58,10 +58,10 @@ fn title_init() -> TitleModel {
5858

5959
fn title_update(msg: TitleMsg, model: TitleModel) -> TitleModel {
6060
match msg {
61-
NewGame => { screen_w: model.screen_w, screen_h: model.screen_h, bgm_playing: model.bgm_playing, selected: "new_game" },
62-
LoadGame => { screen_w: model.screen_w, screen_h: model.screen_h, bgm_playing: model.bgm_playing, selected: "load_game" },
63-
Settings => { screen_w: model.screen_w, screen_h: model.screen_h, bgm_playing: model.bgm_playing, selected: "settings" },
64-
Credits => { screen_w: model.screen_w, screen_h: model.screen_h, bgm_playing: model.bgm_playing, selected: "credits" }
61+
NewGame => #{ screen_w: model.screen_w, screen_h: model.screen_h, bgm_playing: model.bgm_playing, selected: "new_game" },
62+
LoadGame => #{ screen_w: model.screen_w, screen_h: model.screen_h, bgm_playing: model.bgm_playing, selected: "load_game" },
63+
Settings => #{ screen_w: model.screen_w, screen_h: model.screen_h, bgm_playing: model.bgm_playing, selected: "settings" },
64+
Credits => #{ screen_w: model.screen_w, screen_h: model.screen_h, bgm_playing: model.bgm_playing, selected: "credits" }
6565
}
6666
}
6767

@@ -84,7 +84,7 @@ fn title_subs(model: TitleModel) -> String {
8484
// ── main ──────────────────────────────────────────────────────────────────────
8585

8686
fn main() -> () {
87-
tea_run({
87+
tea_run(#{
8888
init: title_init,
8989
update: title_update,
9090
view: title_view,

0 commit comments

Comments
 (0)