✓
Passing This code compiles and runs correctly.
Code
// A `~`-line always begins a NEW Koru construct, so a module annotation placed
// directly above `~import` must stay module-level — no blank line required, and
// no collapse into the import. Pins the PARSE003 bug surfaced by 330_070.
~[strict]
~import std/io
Expected AST
{
"module_annotations": [
"strict"
],
"items": [
{
"type": "import_decl",
"path": "std/compiler",
"location": {
"file": "tests/regression/200_COMPILER_FEATURES/210_PARSER/210_121_module_annotation_above_import/input.kz",
"line": 2,
"col": 0
}
},
{
"type": "host_line",
"module": "input",
"location": {
"file": "tests/regression/200_COMPILER_FEATURES/210_PARSER/210_121_module_annotation_above_import/input.kz",
"line": 2,
"col": 0
}
},
{
"type": "host_line",
"module": "input",
"location": {
"file": "tests/regression/200_COMPILER_FEATURES/210_PARSER/210_121_module_annotation_above_import/input.kz",
"line": 3,
"col": 0
}
},
{
"type": "host_line",
"module": "input",
"location": {
"file": "tests/regression/200_COMPILER_FEATURES/210_PARSER/210_121_module_annotation_above_import/input.kz",
"line": 4,
"col": 0
}
},
{
"type": "import_decl",
"path": "std/io",
"location": {
"file": "tests/regression/200_COMPILER_FEATURES/210_PARSER/210_121_module_annotation_above_import/input.kz",
"line": 7,
"col": 0
}
}
]
}Test Configuration
PARSER_TEST