fix arg comma messages

This commit is contained in:
Folkert 2021-02-25 14:25:43 +01:00
parent 1a7fd57833
commit c208f500d9
4 changed files with 370 additions and 35 deletions

View file

@ -4912,6 +4912,56 @@ mod test_reporting {
)
}
#[test]
fn lambda_double_comma() {
report_problem_as(
indoc!(
r#"
\a,,b -> 1
"#
),
indoc!(
r#"
UNFINISHED ARGUMENT LIST
I am in the middle of parsing a function argument list, but I got
stuck at this comma:
1 \,b -> 1
^
I was expecting an argument pattern before this, so try adding an
argument before the comma and see if that helps?
"#
),
)
}
#[test]
fn lambda_leading_comma() {
report_problem_as(
indoc!(
r#"
\,b -> 1
"#
),
indoc!(
r#"
UNFINISHED ARGUMENT LIST
I am in the middle of parsing a function argument list, but I got
stuck at this comma:
1 \,b -> 1
^
I was expecting an argument pattern before this, so try adding an
argument before the comma and see if that helps?
"#
),
)
}
#[test]
fn when_outdented_branch() {
// this should get better with time