mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 15:51:12 +00:00
make parser helpers emit a more specific error (line too long)
This commit is contained in:
parent
94fc5a1935
commit
5ec0103996
4 changed files with 32 additions and 12 deletions
|
@ -484,11 +484,15 @@ where
|
|||
' ' => {
|
||||
// Don't check indentation here; it might not be enough
|
||||
// indentation yet, but maybe it will be after more spaces happen!
|
||||
state = state.advance_spaces_e(arena, 1, space_problem)?;
|
||||
state = state.advance_spaces_e(arena, 1, |r, c| {
|
||||
space_problem(BadInputError::LineTooLong, r, c)
|
||||
})?;
|
||||
}
|
||||
'\r' => {
|
||||
// Ignore carriage returns.
|
||||
state = state.advance_spaces_e(arena, 1, space_problem)?;
|
||||
state = state.advance_spaces_e(arena, 1, |r, c| {
|
||||
space_problem(BadInputError::LineTooLong, r, c)
|
||||
})?;
|
||||
}
|
||||
'\n' => {
|
||||
// don't need to check the indent here since we'll reset it
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue