Compile artifacts for lrgrep; upgrade menhir version to 20231231#2880
Merged
ncik-roberts merged 10 commits intooxcaml:mainfrom Aug 6, 2024
Merged
Conversation
lpw25
reviewed
Aug 5, 2024
Collaborator
lpw25
left a comment
There was a problem hiding this comment.
Looks good to me, although it's not clear why you still need to do any copying for parser_types.ml. This PR needs performance testing before we merge it, just in case it has made the parser noticeably slower.
lpw25
approved these changes
Aug 5, 2024
Collaborator
lpw25
left a comment
There was a problem hiding this comment.
Looks like there might be a superfluous line left over. Other than that it is good to go. As discussed offline, happy to merge first and then double check there isn't a performance regression.
…face they come from. Also, more clearly explained why the parser_types module is necessary
1d3579d to
7c29b41
Compare
lukemaurer
pushed a commit
that referenced
this pull request
Oct 23, 2024
… to 20231231 (#2880) * mend * Removed accidentally included lrgrep build artifacts from build file * Make sure parser.cmly gets put into the _install directory * Removed unnecessary cat of parser_types because Menhir adds the interface they come from. Also, more clearly explained why the parser_types module is necessary * Undo style changes to preprocess clause * Undo style changes to preprocess clause * Removed unnecessary preprocessor depedencies * Update parser and parser types to account for changes from rebase * Remove accidental modifications to .gitignore * Re-added strategy simplified and fixed-exception flags
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 generates the necessary build artifacts to use lrgrep for better syntax error messages. This amounted to adding the --cmly and --inspection flags to the menhir stanza in ocaml/dune when building the parser. Lrgrep also requires menhir >= 20211128, so this updates the pin on menhir to enable that. It also makes sure to install the parser.cmly to the install directory so it's accessible for other projects.
When adding the --inspection flag to compile the parser, menhir will generate the inspection API. Some functions / types in this API will refer to types that are defined inside parser.mly (ex., Constant.t or let_binding), but menhir doesn't include these types in the autogenerated parser.mli file, and it causes the build to fail. To get around this, type declarations are moved into the helper parser_types.ml and parser_types.mli files (this is what lrgrep does).
Also, I'm not sure why flambda_parser.ml updated, or if that update was necessary. I included it in the PR just in case these changes from updating the menhir version are meaningful.