✗
Failing This test is currently failing.
Failed: ast-mismatch
Code
// Pins: a declaration's recorded AST location is a line of the USER'S file.
// `~tor solo` is written on line 11 and must be recorded as line 11.
//
// The guarded shape is a disagreement between two coordinate systems inside
// one compiler: `-->` diagnostics count from the user's line 1 (510_106,
// 210_160), while node locations count from the injected buffer. They cannot
// both be right, and a consumer of --ast-json cannot tell which it holds.
//
// The claim is the DECLARATION's line only. What line a compiler-injected
// node should report is a separate question and is left as the toolchain
// currently answers it — this golden was generated by the toolchain with that
// one value corrected, so only the declaration is being asserted.
~tor solo {
id: usize
}
Expected AST
{
"module_annotations": [],
"items": [
{
"type": "import_decl",
"path": "std/compiler",
"location": {
"file": "tests/regression/200_COMPILER_FEATURES/210_PARSER/210_164_ast_locations_are_file_relative/input.kz",
"line": 2,
"col": 0
}
},
{
"type": "host_line",
"module": "input",
"location": {
"file": "tests/regression/200_COMPILER_FEATURES/210_PARSER/210_164_ast_locations_are_file_relative/input.kz",
"line": 2,
"col": 0
}
},
{
"type": "host_line",
"module": "input",
"location": {
"file": "tests/regression/200_COMPILER_FEATURES/210_PARSER/210_164_ast_locations_are_file_relative/input.kz",
"line": 3,
"col": 0
}
},
{
"type": "host_line",
"module": "input",
"location": {
"file": "tests/regression/200_COMPILER_FEATURES/210_PARSER/210_164_ast_locations_are_file_relative/input.kz",
"line": 4,
"col": 0
}
},
{
"type": "host_line",
"module": "input",
"location": {
"file": "tests/regression/200_COMPILER_FEATURES/210_PARSER/210_164_ast_locations_are_file_relative/input.kz",
"line": 5,
"col": 0
}
},
{
"type": "host_line",
"module": "input",
"location": {
"file": "tests/regression/200_COMPILER_FEATURES/210_PARSER/210_164_ast_locations_are_file_relative/input.kz",
"line": 6,
"col": 0
}
},
{
"type": "host_line",
"module": "input",
"location": {
"file": "tests/regression/200_COMPILER_FEATURES/210_PARSER/210_164_ast_locations_are_file_relative/input.kz",
"line": 7,
"col": 0
}
},
{
"type": "host_line",
"module": "input",
"location": {
"file": "tests/regression/200_COMPILER_FEATURES/210_PARSER/210_164_ast_locations_are_file_relative/input.kz",
"line": 8,
"col": 0
}
},
{
"type": "host_line",
"module": "input",
"location": {
"file": "tests/regression/200_COMPILER_FEATURES/210_PARSER/210_164_ast_locations_are_file_relative/input.kz",
"line": 9,
"col": 0
}
},
{
"type": "host_line",
"module": "input",
"location": {
"file": "tests/regression/200_COMPILER_FEATURES/210_PARSER/210_164_ast_locations_are_file_relative/input.kz",
"line": 10,
"col": 0
}
},
{
"type": "host_line",
"module": "input",
"location": {
"file": "tests/regression/200_COMPILER_FEATURES/210_PARSER/210_164_ast_locations_are_file_relative/input.kz",
"line": 11,
"col": 0
}
},
{
"type": "host_line",
"module": "input",
"location": {
"file": "tests/regression/200_COMPILER_FEATURES/210_PARSER/210_164_ast_locations_are_file_relative/input.kz",
"line": 12,
"col": 0
}
},
{
"type": "host_line",
"module": "input",
"location": {
"file": "tests/regression/200_COMPILER_FEATURES/210_PARSER/210_164_ast_locations_are_file_relative/input.kz",
"line": 13,
"col": 0
}
},
{
"type": "event_decl",
"name": "solo",
"path": [
"solo"
],
"module": "input",
"input": {
"fields": [
{
"name": "id",
"type": "usize",
"is_source": false,
"is_file": false,
"is_embed_file": false,
"is_expression": false,
"is_invocation_meta": false,
"phantom": null
}
]
},
"branches": [],
"location": {
"file": "tests/regression/200_COMPILER_FEATURES/210_PARSER/210_164_ast_locations_are_file_relative/input.kz",
"line": 13,
"col": 0
}
}
]
}Test Configuration
PARSER_TEST