✓
Passing This code compiles and runs correctly.
Code
// ============================================================================
// Regression test: event input shape braces may begin on a following line
// Also verifies branch payload shapes can span multiple lines cleanly
// ============================================================================
~event example.write
// intentionally keep the opening brace on the next line
{
value: i32,
note: []const u8,
}
| success {
written: usize,
}
| failure {
message: []const u8,
}
Expected AST
{
"module_annotations": [],
"items": [
{
"type": "import_decl",
"path": "$std/compiler",
"location": {
"file": "tests/regression/200_COMPILER_FEATURES/210_PARSER/210_001_event_multiline_shape/input.kz",
"line": 2,
"col": 0
}
},
{
"type": "host_line",
"module": "input",
"location": {
"file": "tests/regression/200_COMPILER_FEATURES/210_PARSER/210_001_event_multiline_shape/input.kz",
"line": 2,
"col": 0
}
},
{
"type": "host_line",
"module": "input",
"location": {
"file": "tests/regression/200_COMPILER_FEATURES/210_PARSER/210_001_event_multiline_shape/input.kz",
"line": 3,
"col": 0
}
},
{
"type": "host_line",
"module": "input",
"location": {
"file": "tests/regression/200_COMPILER_FEATURES/210_PARSER/210_001_event_multiline_shape/input.kz",
"line": 4,
"col": 0
}
},
{
"type": "host_line",
"module": "input",
"location": {
"file": "tests/regression/200_COMPILER_FEATURES/210_PARSER/210_001_event_multiline_shape/input.kz",
"line": 5,
"col": 0
}
},
{
"type": "event_decl",
"name": "write",
"path": [
"example",
"write"
],
"module": "input",
"input": {
"fields": [
{
"name": "value",
"type": "i32",
"is_source": false,
"is_file": false,
"is_embed_file": false,
"is_expression": false,
"is_invocation_meta": false
},
{
"name": "note",
"type": "[]const u8",
"is_source": false,
"is_file": false,
"is_embed_file": false,
"is_expression": false,
"is_invocation_meta": false
}
]
},
"branches": [
{
"name": "success",
"payload": {
"fields": [
{
"name": "written",
"type": "usize",
"is_source": false,
"is_file": false,
"is_embed_file": false,
"is_expression": false,
"is_invocation_meta": false
}
]
}
},
{
"name": "failure",
"payload": {
"fields": [
{
"name": "message",
"type": "[]const u8",
"is_source": false,
"is_file": false,
"is_embed_file": false,
"is_expression": false,
"is_invocation_meta": false
}
]
}
}
],
"location": {
"file": "tests/regression/200_COMPILER_FEATURES/210_PARSER/210_001_event_multiline_shape/input.kz",
"line": 19,
"col": 0
}
}
]
}Test Configuration
PARSER_TEST