Skip to content
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

Allow parsing of non-root productions #239

Merged
merged 2 commits into from
Jun 27, 2022

Conversation

mccolljr
Copy link
Contributor

This is currently a work in progress, but this PR will allow parsing non-root productions using a parser. This can be useful when implementing Parseable or using ParseTypeWith.

@mccolljr mccolljr force-pushed the feat/parse-subprod branch from 657affe to 2227472 Compare June 15, 2022 14:43
@mccolljr mccolljr changed the title (WIP) Parse non-root productions Allow parsing of non-root productions Jun 15, 2022
@mccolljr
Copy link
Contributor Author

@alecthomas wanted to solicit initial feedback before I finish up this PR using this appraoch

@alecthomas
Copy link
Owner

Looks pretty reasonable to me, thanks!

@mccolljr mccolljr marked this pull request as ready for review June 20, 2022 13:56
@alecthomas alecthomas merged commit fe65687 into alecthomas:master Jun 27, 2022
@alecthomas
Copy link
Owner

Thanks!

@alecthomas
Copy link
Owner

I just merged 1261c4d which makes the parser itself generic. As part of that I added a func ParserForProduction[P, G any](parser *Parser[G]) (*Parser[P], error) which safely retrieves a parser for a production.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants