✓
Passing Passing: the compiler rejects this program as expected.
Code
// ============================================================================
// TEST: Pattern Branches Parser Support
// ============================================================================
// Verifies that the parser correctly handles [...] pattern branch syntax.
// Pattern branches allow opaque expressions as branch names for DSL transforms.
//
// The [...] content is passed through as the branch name - transforms interpret it.
// ============================================================================
// Simple event to test pattern branches
~tor test-patterns {}
~proc test-patterns|zig {
}
// Test that pattern branches parse correctly
// The branch names are [GET /users/:id] etc - opaque to the compiler
~test-patterns()
| [GET /users/:id] => ok
| [POST /users] => ok
| [nested [brackets] work] => ok
| [* -> stopped] => ok // State machine style
// Verify nested patterns work
~test-patterns()
| [/admin/*] |> test-patterns()
| [GET /dashboard] => ok
Actual compiler output
error[KORU021]: event 'input:test-patterns' has no branch 'GET /users/:id' (available: (none))
--> tests/regression/200_COMPILER_FEATURES/210_PARSER/210_052_pattern_branches/input.kz:19:0
error[KORU021]: event 'input:test-patterns' has no branch 'POST /users' (available: (none))
--> tests/regression/200_COMPILER_FEATURES/210_PARSER/210_052_pattern_branches/input.kz:20:0
error[KORU021]: event 'input:test-patterns' has no branch 'nested [brackets] work' (available: (none))
--> tests/regression/200_COMPILER_FEATURES/210_PARSER/210_052_pattern_branches/input.kz:21:0
error[KORU021]: event 'input:test-patterns' has no branch '* -> stopped' (available: (none))
--> tests/regression/200_COMPILER_FEATURES/210_PARSER/210_052_pattern_branches/input.kz:22:0
❌ Compiler coordination error: Incomplete branch coverage
(set KORU_BACKEND_TRACE=1 for the backend return trace)Must contain:
no branch 'GET /users/:id'Flows
flow ~test-patterns click a branch to expand · @labels scroll to their anchor
test-patterns
flow ~test-patterns click a branch to expand · @labels scroll to their anchor
test-patterns
Test Configuration
MUST_ERROR