mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 22:34:45 +00:00
fix arg comma messages
This commit is contained in:
parent
1a7fd57833
commit
c208f500d9
4 changed files with 370 additions and 35 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue