-
Notifications
You must be signed in to change notification settings - Fork 38
Change YaccKind parameters to a new YaccKindResolver type
#492
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
Conversation
|
This looks close to being ready to merge to me. Since it will imply a breaking release I have two "not exactly related, but worth noting here" thoughts:
|
|
Regarding 2. I think I should at least work on the lrlex variation of But everything else I can think of that has been on my radar has been non-breaking. Edit: I'll keep it in mind though as I work on the lex stuff. |
|
I think we're ready to squash? If so, please go ahead. |
This is a breaking change which adds a `YaccKindResolver` type. `YaccKindResolver` can allow a yacc grammar to be read from a `%grmtools` section of a yacc grammar source file. CTParserBuilder which previously required a YaccKind, has been relaxed to allow the YaccKind to be unspecified in which case it will now attempt to find the `yacckind` in the `%grmtools` section. nimbleparse previously would default to using `YaccKind::Original`, now attempts to read the yacc kind from the `%grmtools` section and otherwise throws an error. This should improve error messages and avoid defaulting to the wrong yacc kind. Fixes softdevteam#349
c84c3f2 to
2ffcffb
Compare
|
Squashed. |
|
Edit: After thinking about it, I don't really think there is anything here that can't be done in a totally compatible fashion. So the first thing that came to mind (could potentially be some kind of breaking change, uncertain about that though). Has to do with source code generation, currently we have like nimbleparse, and build.rs code typically uses It isn't really clear that Then we also have issues like #448 (This is only tangentially related to the above in that one could consider graphviz or railroad diagrams as output) and one could imagine some kind of I'm not certain I currently have any real specific/concrete API in mind, and I'm not sure it's necessary to do so in a breaking fashion, but there is this seed of an idea that both diagram and source generation have this generation/output step in common, so we could consider that sort of thing from first principles if you'd like. Perhaps I should make a separate issue for this stuff? |
Here is take two on my previous PR #491
Had to slightly rush to get this out the door, as there is a possibility I may not be able to work on this or respond for a few days but hopefully nothing has been overlooked.
I did slightly relax the documentation string for
YaccKindResolver::Forcethat you had given, changing it from being an error if they differ, to an error unless they are compatible. This is primarily to allow for differingYaccOriginalActionKindbehaviors when used with theOriginalkind.I've added
%grmtoolssections to some of the files in the repo while testing, but certainly not all this should probablydone though.
--
This is a breaking change which adds a
YaccKindResolvertype.YaccKindResolvercan allow a yacc grammar to be read from a%grmtoolssection of a yacc grammar source file.CTParserBuilder which previously required a YaccKind, has been relaxed to allow the YaccKind to be unspecified in which case it will now attempt to find the
yacckindin the%grmtoolssection.nimbleparse previously would default to using
YaccKind::Original, now attempts to read the yacc kind from the%grmtoolssection and otherwise throws an error. This should improve error messages and avoid defaulting to the wrong yacc kind.