Repository navigation
Make codegen pub - #672
Draft
ratmice wants to merge 6 commits into
Draft
Make codegen pub#672ratmice wants to merge 6 commits into
ratmice wants to merge 6 commits into
Conversation
This leaves `Value`, `HeaderError`, and `HeaderErrorKind` publicly visible.
ratmice
marked this pull request as draft
November 29, 2026 12:12
Collaborator
Author
|
Besides a more exhaustive check of the errors, this probably also needs a read through the rustdoc output. At a first glance, a lot of the codegen docs are in fact missing. |
ratmice
commented
Nov 29, 2026
| } | ||
|
|
||
| /// A Parser source environment is the first step in a *Sans-I/O* interface to source code generation. | ||
| /// |
Collaborator
Author
There was a problem hiding this comment.
I think I'm probably going about this the wrong way, in that I think the "first step"
parts here and elsewhere that i describe the sequence of order of structures in the codegen process
really belong in the leading module documentation,
because these structures being in alphabetical order makes it really confusing.
I'll continue working on this tomorrow.
This branch has not been deployed
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 is a first attempt at my remaining todo list.
It tries to make codegen pub, and remove the usage of hidden API in nimbleparse.
It does so by usage of the codegen process and selectively unhiding some API we've worked towards making nicer over this development cycle (the
header::Valuestructure and header errors).The actual errors that are going to be emitted here will very likely need some work,
But I did do a basic smoke test run of nimbleparse with some erroneous input.
The usage of codegen might seem weird, nimbleparse doesn't actually generating any code...
We kind of use it as a "PreBuilder" for RTParserBuilder which does a couple of things
%grmtools{yacckind: ...}by parsing the%grmtoolssection.As an example of step 3, we can add an invalid key to one of the examples
$ cargo run --bin nimbleparse -- ./lrpar/examples/calc_parsetree/src/calc.{l,y}I had hoped to before making this stuff
pub, get a version of nimbleparse_lsp ready to test with.But that was before I had noticed the hidden API usage in nimbleparse. In this regard, there isn't
much that could go wrong in nimbleparse_lsp that wouldn't also run afoul of nimbleparse itself.
I would say that the
codegenerror handling is not totally pretty here.I should probably go through
CTParserBuilderand double check it's error handling,to see if I missed any nicer mechanisms. Despite that, it does seem to come out as a net negative lines of code 👏