-
Notifications
You must be signed in to change notification settings - Fork 2
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
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.
Nice! |
github-merge-queue
bot
removed this pull request from the merge queue due to failed status checks
Jun 3, 2024
I'm an idiot. OK to squash? |
Previously if name matching matched input, you had to guess what had been matched: this change now prints it out in the error summary.
OK |
ltratt
force-pushed
the
better_reporting_of_errors
branch
from
June 3, 2024 13:44
dbfd1da
to
7b2591b
Compare
Squashed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes/changes a number of error location reporting "things". One is a clear bug (ba7da28) but two others (9794e4e, 6542ea4) are "this makes finding what wrong easier" rather than "bug". Finally a1462a0 is a different aspect of "make finding what wrong easier".
I've used each of these while debugging some fairly hairy pattern matching failures.