✓
Passing This code compiles and runs correctly.
Code
// Test: [expand] annotation for template-based code generation
// This tests the simplest case: an event with [expand] that uses a template
// to generate inline Zig code without needing a proc.
import std/template
// Define template in user-land using the imported define event
std/template:define(name: "debug-print") {
@import("std").debug.print("value: {d}\n", .{ {{ value }} });
}
// Event with [norun|expand] - implementation comes from template
// [norun] = not emitted anywhere
// [expand] = processed by transform_pass_runner via template lookup
[norun|expand]pub event debug-print { value: Expression }
// Use it - note the ~ prefix to make it a Koru flow!
debug-print(value: 42)
Actual
value: 42
Expected output
value: 42
Flows
flow ~define click a branch to expand · @labels scroll to their anchor
define (name: "debug-print", source: @import("std").debug.print("value: {d}\n", .{ {{ value }} });)
flow ~debug-print click a branch to expand · @labels scroll to their anchor
debug-print (value: 42)
Test Configuration
MUST_RUN