Improve switch's diagnostics
This commit is contained in:
parent
e29ffb2a9c
commit
f695f8a52e
17 changed files with 2702 additions and 231 deletions
|
|
@ -9,6 +9,7 @@ mod block_items;
|
|||
mod control_flow_expressions;
|
||||
mod primary_expressions;
|
||||
mod selector_expressions;
|
||||
mod switch_expressions;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub(super) struct ExpectedLabel {
|
||||
|
|
|
|||
|
|
@ -397,7 +397,7 @@ pub(super) const P0033_FIXTURES: &[Fixture] = &[
|
|||
},
|
||||
Fixture {
|
||||
label: "files/P0033_02.uc",
|
||||
source: "{\n Func\n (A\n :,\n B);\n Log(\"after\");\n}\n",
|
||||
source: "{\n Func\n (A\n #,\n B);\n Log(\"after\");\n}\n",
|
||||
},
|
||||
Fixture {
|
||||
label: "files/P0033_03.uc",
|
||||
|
|
@ -670,7 +670,7 @@ fn check_p0033_fixtures() {
|
|||
assert_diagnostic(
|
||||
&runs.get_any("files/P0033_02.uc"),
|
||||
&ExpectedDiagnostic {
|
||||
headline: "expected `,` or `)` after argument, found `:`",
|
||||
headline: "expected `,` or `)` after argument, found `#`",
|
||||
severity: Severity::Error,
|
||||
code: Some("P0033"),
|
||||
primary_label: Some(ExpectedLabel {
|
||||
|
|
@ -678,7 +678,7 @@ fn check_p0033_fixtures() {
|
|||
start: TokenPosition(10),
|
||||
end: TokenPosition(10),
|
||||
},
|
||||
message: "unexpected `:`",
|
||||
message: "unexpected `#`",
|
||||
}),
|
||||
secondary_labels: &[
|
||||
ExpectedLabel {
|
||||
|
|
|
|||
1506
rottlib/tests/parser_diagnostics/switch_expressions.rs
Normal file
1506
rottlib/tests/parser_diagnostics/switch_expressions.rs
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue