✓
Passing This code compiles and runs correctly.
Code
// Test 210_079: the `->` producer carries a Zig expression at body position as
// an `.expression` Node (not an invocation — invocations always have parens).
// `! ask _ -> "Alice"` produces the resume value; the bare string is an
// `.expression` Node carrying the Zig source. (`|>` cannot introduce a value —
// that is KORU103; the producer glyph is `->`.)
~pub event prompt-user { question: []const u8 }
! ask []const u8 -> []const u8
| done
~prompt-user(question: "X?")
! ask _ -> "Alice"
| done |> _
Flows
flow ~prompt-user click a branch to expand · @labels scroll to their anchor
prompt-user (question: "X?")
Expected AST
{
"module_annotations": [],
"items": [
{
"type": "import_decl",
"path": "std/compiler",
"location": {
"file": "tests/regression/200_COMPILER_FEATURES/210_PARSER/210_079_effect_branch_resume_expression/input.kz",
"line": 2,
"col": 0
}
},
{
"type": "host_line",
"module": "input",
"location": {
"file": "tests/regression/200_COMPILER_FEATURES/210_PARSER/210_079_effect_branch_resume_expression/input.kz",
"line": 2,
"col": 0
}
},
{
"type": "host_line",
"module": "input",
"location": {
"file": "tests/regression/200_COMPILER_FEATURES/210_PARSER/210_079_effect_branch_resume_expression/input.kz",
"line": 3,
"col": 0
}
},
{
"type": "host_line",
"module": "input",
"location": {
"file": "tests/regression/200_COMPILER_FEATURES/210_PARSER/210_079_effect_branch_resume_expression/input.kz",
"line": 4,
"col": 0
}
},
{
"type": "host_line",
"module": "input",
"location": {
"file": "tests/regression/200_COMPILER_FEATURES/210_PARSER/210_079_effect_branch_resume_expression/input.kz",
"line": 5,
"col": 0
}
},
{
"type": "host_line",
"module": "input",
"location": {
"file": "tests/regression/200_COMPILER_FEATURES/210_PARSER/210_079_effect_branch_resume_expression/input.kz",
"line": 6,
"col": 0
}
},
{
"type": "event_decl",
"name": "prompt-user",
"path": [
"prompt-user"
],
"module": "input",
"input": {
"fields": [
{
"name": "question",
"type": "[]const u8",
"is_source": false,
"is_file": false,
"is_embed_file": false,
"is_expression": false,
"is_invocation_meta": false,
"phantom": null
}
]
},
"branches": [
{
"name": "ask",
"kind": "effect",
"resume": "[]const u8",
"resume_phantom": null,
"is_optional": false,
"is_panic": false,
"payload": {
"fields": [
{
"name": "__type_ref",
"type": "[]const u8",
"is_source": false,
"is_file": false,
"is_embed_file": false,
"is_expression": false,
"is_invocation_meta": false,
"phantom": null
}
]
}
},
{
"name": "done",
"kind": "terminal",
"resume": null,
"resume_phantom": null,
"is_optional": false,
"is_panic": false,
"payload": {
"fields": []
}
}
],
"location": {
"file": "tests/regression/200_COMPILER_FEATURES/210_PARSER/210_079_effect_branch_resume_expression/input.kz",
"line": 11,
"col": 0
}
},
{
"type": "flow",
"invocation": {
"event": [
"prompt-user"
],
"args": [
{
"name": "question",
"value": "\"X?\""
}
],
"variant": null
},
"continuations": [
{
"branch": "ask",
"kind": "effect",
"is_catchall": false,
"binding": "_",
"binding_type": "branch_payload",
"condition": null,
"step": {
"type": "expression",
"expression": "\"Alice\""
},
"continuations": []
},
{
"branch": "done",
"kind": "terminal",
"is_catchall": false,
"binding": null,
"binding_type": "branch_payload",
"condition": null,
"step": {
"type": "terminal"
},
"continuations": []
}
],
"pre_label": null,
"impl_of": null,
"location": {
"file": "tests/regression/200_COMPILER_FEATURES/210_PARSER/210_079_effect_branch_resume_expression/input.kz",
"line": 12,
"col": 0
}
}
]
}Test Configuration
PARSER_TEST