mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
bring parse errors into the reporting tests
This commit is contained in:
parent
5e500f55ae
commit
e21cdfc689
4 changed files with 91 additions and 138 deletions
|
@ -1247,7 +1247,11 @@ pub fn ident_etc<'a>(min_indent: u16) -> impl Parser<'a, Expr<'a>> {
|
|||
(Some(_loc_args), Some((_spaces_before_equals, Either::First(_equals_indent)))) => {
|
||||
// We got args with an '=' after them, e.g. `foo a b = ...`
|
||||
// This is a syntax error!
|
||||
panic!("TODO gracefully handle parse error for defs like `foo a b = ...`");
|
||||
let fail = Fail {
|
||||
attempting: state.attempting,
|
||||
reason: FailReason::ArgumentsBeforeEquals,
|
||||
};
|
||||
Err((fail, state))
|
||||
}
|
||||
(None, Some((spaces_before_equals, Either::First(equals_indent)))) => {
|
||||
// We got '=' with no args before it
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue