026 for subflow

✓ Passing This code compiles and runs correctly.

Code

// Test: ~for as subflow starting point
// This must work - transforms should apply to subflow bodies

~import "$std/io"
~import "$std/control"

const std = @import("std");

// Event that uses ~for in its implementation
~event count_to_three {}
| result { total: i32 }

// Subflow implementation using ~for as the starting construct
~count_to_three = for(0..3)
| each _ |> std.io:println(text: "counting")
| done |> result { total: 3 }

// Main flow calls the subflow
~count_to_three()
| result _ |> std.io:println(text: "done")
input.kz

Expected Output

counting
counting
counting
done

Test Configuration

MUST_RUN