Skip to content
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

Better reporting of errors #47

Merged
merged 5 commits into from
Jun 3, 2024

Commits on Jun 3, 2024

  1. Fix pattern error reporting bug.

    When using the `..~` operator, it could eventually match after having
    failed several times, and accidentally increment the apparent line the
    pattern failed to match at. This didn't affect the matching algorithm,
    but meant that a failure to match would report the wrong position in the
    pattern. The new test line below incorrectly reported `(8, 6)` before
    the fix in this commit.
    ltratt committed Jun 3, 2024
    Configuration menu
    Copy the full SHA
    ba7da28 View commit details
    Browse the repository at this point in the history
  2. Remove unnecessary variable.

    ltratt committed Jun 3, 2024
    Configuration menu
    Copy the full SHA
    2f9d8f2 View commit details
    Browse the repository at this point in the history
  3. Have ..~ report pattern line errors in the same way as ....

    When `...` fails to match it (sensibly) tells you that the error was on
    the of the pattern *after* the `...`, but `..~` reported the pattern
    line itself. This commit makes `..~` follow `...`s behaviour.
    ltratt committed Jun 3, 2024
    Configuration menu
    Copy the full SHA
    9794e4e View commit details
    Browse the repository at this point in the history
  4. Report the text line where pattern failed to match from.

    Previously when `...` failed, it told you how-far-it-got before
    realising it had failed, rather than the more useful where-it-started.
    This commit fixes that.
    ltratt committed Jun 3, 2024
    Configuration menu
    Copy the full SHA
    6542ea4 View commit details
    Browse the repository at this point in the history
  5. Report any names matched when matching fails.

    Previously if name matching matched input, you had to guess what had
    been matched: this change now prints it out in the error summary.
    ltratt committed Jun 3, 2024
    Configuration menu
    Copy the full SHA
    7b2591b View commit details
    Browse the repository at this point in the history