✓
Passing This code compiles and runs correctly.
Code
// ============================================================================
// PARSER BUG: Multi-line function calls in subflows break continuation parsing
// ============================================================================
//
// The parser fails to recognize continuation lines after multi-line function
// calls in subflow expressions. After the closing ')' of a multi-line call,
// the next '|' is treated as a "stray continuation line" instead of being
// recognized as part of the subflow.
//
// Expected: Parser should handle multi-line calls and continue parsing the flow
// Actual: Parser loses track of subflow context after ')'
//
// Do not work around this by moving the event composition into a proc. Procs are
// host/Zig implementation space; this repro exists because the subflow form is
// the intended authoring model.
//
// This bug was discovered while implementing benchmark 2101b_nbody_granular,
// which needed to pass multiple arguments to assemble-solar-system() across
// multiple lines.
//
// ============================================================================
const std = @import("std");
~event step-a { x: i32 }
| done i32
~proc step-a|zig {
return .{ .done = x + 1 };
}
~event step-b { a: i32, b: i32, c: i32 }
| done i32
~proc step-b|zig {
return .{ .done = a + b + c };
}
~event step-c { x: i32 }
| done i32
~proc step-c|zig {
return .{ .done = x * 2 };
}
// This subflow should work but currently fails
~event test-multiline-call {}
| final i32
~test-multiline-call = step-a(x: 10)
| done a |> step-b(
a,
b: 20,
c: 30
)
| done b |> step-c(x: b)
| done c => final c
// Main flow
~test-multiline-call()
| final _ |> _