migrate to the new for-loop syntax

Drop the ':' before captures (for xs (x) / for 0..n (i)); the index
capture becomes the trailing open range (for xs, 0.. (x, i)). 136
headers across 26 files, mechanical.

Five headless tests (banner_layout, hit_test, swipe_commit,
swipe_intent, swipe_reshuffle) also gain a direct
#import "modules/ui/types.sx" — they named Point/Frame through a
transitive import, which bare visibility no longer permits.

Gates: sx build --target ios-sim main.sx links; tools/run_tests.sh
23/23.
This commit is contained in:
swipelab
2026-06-10 20:39:59 +03:00
parent 5a0627bb7c
commit a7b41ccbca
28 changed files with 141 additions and 136 deletions

View File

@@ -24,8 +24,8 @@ main :: () -> s32 {
// 1. t==0 idle pose is EXACTLY rest for every cell (the determinism invariant).
print("== idle t=0 is rest for all cells ==\n");
rest_ok := true;
for 0..BOARD_ROWS: (row) {
for 0..BOARD_COLS: (col) {
for 0..BOARD_ROWS (row) {
for 0..BOARD_COLS (col) {
p := idle_pose(0.0, col, row);
if !(p.scale_x == 1.0 and p.scale_y == 1.0 and p.dx == 0.0 and p.dy == 0.0) {
rest_ok = false;
@@ -39,8 +39,8 @@ main :: () -> s32 {
print("== idle mid-phase deforms, bounded ==\n");
moved := false;
bounded := true;
for 0..BOARD_ROWS: (row) {
for 0..BOARD_COLS: (col) {
for 0..BOARD_ROWS (row) {
for 0..BOARD_COLS (col) {
p := idle_pose(0.6, col, row);
if fabs(p.scale_x - 1.0) > 0.0005 { moved = true; }
if fabs(p.scale_x - 1.0) > 0.05 { bounded = false; }
@@ -82,7 +82,7 @@ main :: () -> s32 {
c_peak := clear_pop_scale(0.30) > 1.1;
c_collapse := true;
pc := clear_pop_scale(CLEAR_POP_RISE);
for 1..21: (i) {
for 1..21 (i) {
tt := CLEAR_POP_RISE + (1.0 - CLEAR_POP_RISE) * cast(f32) i / 20.0;
vv := clear_pop_scale(tt);
if vv > pc + 0.000001 { c_collapse = false; }