Integrate LRgrep error messages#2072
Open
let-def wants to merge 7 commits into
Open
Conversation
This file contains hidden or 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
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 integrates LRgrep to generate syntax error messages. This change improves the quality and consistency of error reporting while, hopefully, making the error-handling logic more maintainable. Currently, this is an additive change that complements the existing parser without modifying or removing any existing behavior.
Main changes:
src/ocaml/preprocess/parse_errors.lrgrep, which defines syntax error messages in a clear, declarative format.make lrgrep-coveragetarget generatescoverage.md, a report listing grammatical constructs that currently lack error messages, along with actionable hints for adding coverage.src/ocaml/preprocess/, following the same vendoring pattern used forMenhirLib.The declarative approach should make error messages easier to write, review, and maintain. The coverage tool gives us visibility into error-reporting gaps and guides incremental improvements.
While this PR is a strict addition, the long-term goal is to gradually replace parser components with a version more tightly integrated with LRgrep. This will significantly simplify the preprocessing pipeline and reduce boilerplate in the error recovery and explanation code.