mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-15 08:15:07 +00:00
add EExpr error for unexpected comma
This commit is contained in:
parent
62cc19c64b
commit
ca01913ab3
3 changed files with 30 additions and 1 deletions
|
@ -1778,7 +1778,17 @@ fn parse_expr_end<'a>(
|
|||
),
|
||||
),
|
||||
)
|
||||
.parse(arena, state, min_indent)?;
|
||||
.parse(arena, state, min_indent)
|
||||
.map_err(|(progress, err)| {
|
||||
// We were expecting the end of an expression, and parsed a comma
|
||||
// therefore we are either on the LHS of backpassing or this is was
|
||||
// in an invalid position.
|
||||
if let EExpr::Pattern(EPattern::IndentEnd(_), pos) = err {
|
||||
(progress, EExpr::UnexpectedComma(pos.sub(1)))
|
||||
} else {
|
||||
(progress, err)
|
||||
}
|
||||
})?;
|
||||
|
||||
expr_state.consume_spaces(arena);
|
||||
let call = to_call(arena, expr_state.arguments, expr_state.expr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue