-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow the parser to add contextual help text to errors; Add contextua…
…l help text for parenthesized for loops (#1828) Given the problems users have faced with non-parenthesized for loop iterators ([like this one](https://stackoverflow.com/questions/78592805/q-sharp-syntax-error-in-quantum-hhl-algorithm)), we wanted to provide some help text for the user in this situation. Instead of just patching in a fix for precisely this situation, I wanted to use `miette`'s great functionality for composable errors. So, with this change, can now compose any parse error with help text. I also manually implemented `Debug` for `Error` to omit the help text if it isn't present. This is primarily so this PR doesn't add `None` to every single parser expect test which tests errors. (Happy to revert this and update the tests if desired, but I really don't like spraying the diff with 1k lines of expect-test changes that just say `None`)
- Loading branch information
Showing
9 changed files
with
236 additions
and
51 deletions.
There are no files selected for viewing
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
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
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
Oops, something went wrong.