Skip to content

New String function: parseErrorHuman #209

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 28, 2022
Merged

New String function: parseErrorHuman #209

merged 1 commit into from
Oct 28, 2022

Conversation

jamesdbrock
Copy link
Member

@jamesdbrock jamesdbrock commented Oct 16, 2022

New String function: parseErrorHuman

Returns three Strings which, when printed line-by-line, will show a nice human-readable parsing error message.

    let input = "12345six789"
    case runParser input (replicateA 9 String.Basic.digit) of
      Left err -> log $ String.joinWith "\n" $ parseErrorHuman input 20 err
Expected digit at position index:5 (line:1, column:6)
     ▼
12345six789

Checklist:

  • Added the change to the changelog's "Unreleased" section with a link to this PR and your username
  • Linked any existing issues or proposals that this pull request should close
  • Updated or added relevant documentation in the README and/or documentation directory
  • Added a test for the contribution (if applicable)

@jamesdbrock jamesdbrock force-pushed the parseErrorHuman branch 3 times, most recently from 13cc38a to 1589960 Compare October 17, 2022 01:03
@jamesdbrock jamesdbrock force-pushed the parseErrorHuman branch 6 times, most recently from 62b51ea to c4f8990 Compare October 25, 2022 13:26
@jamesdbrock jamesdbrock marked this pull request as ready for review October 25, 2022 13:33
@jamesdbrock jamesdbrock merged commit 4056d08 into main Oct 28, 2022
@jamesdbrock jamesdbrock deleted the parseErrorHuman branch October 28, 2022 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant