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

make sure all named sub-parsers can produce rule kinds #486

Conversation

OmarTawfik
Copy link
Contributor

@OmarTawfik OmarTawfik commented May 25, 2023

Context: #339 (comment)

add support for naming choice parsers, as we can have two nodes of the same kind in succession, and we need to differentiate which is which.

Closes #339

@changeset-bot
Copy link

changeset-bot bot commented May 25, 2023

⚠️ No Changeset found

Latest commit: 2e35aa7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@OmarTawfik OmarTawfik force-pushed the produce-names-for-all-sub-expressions branch 3 times, most recently from 0ac8348 to b1efa97 Compare May 25, 2023 16:53
@OmarTawfik OmarTawfik marked this pull request as ready for review May 25, 2023 18:20
@OmarTawfik OmarTawfik requested a review from a team as a code owner May 25, 2023 18:20
@OmarTawfik OmarTawfik enabled auto-merge May 25, 2023 18:20
@@ -42,6 +42,7 @@ pub enum CombinatorNode<'context> {
primary_expression: &'context CombinatorNode<'context>,
},
Reference {
name: Option<String>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure of the use case for renaming references. The referenced tree is already named. I thought this issue was about eliminating the _* names, which would be done by adding names to e.g. repetitions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure of the use case for renaming references.

The current PR is about #339, which makes sure we can give names to choices + references.

I thought this issue was about eliminating the _* names, which would be done by adding names to e.g. repetitions?

That would be #353, which is still WIP.

For references, it is needed to give names to inlined nodes (that will not generate their own NodeKind). Please check the description of #323 for some examples.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will remove the changes to reference and keep choice.

@OmarTawfik OmarTawfik force-pushed the produce-names-for-all-sub-expressions branch from b1efa97 to 2e35aa7 Compare June 1, 2023 06:03
@OmarTawfik
Copy link
Contributor Author

@AntonyBlakey comment addressed.

@OmarTawfik OmarTawfik added this pull request to the merge queue Jun 1, 2023
Merged via the queue into NomicFoundation:main with commit ba5ea9a Jun 1, 2023
@OmarTawfik OmarTawfik deleted the produce-names-for-all-sub-expressions branch June 1, 2023 06:29
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.

not all named sub-expressions produce their own RuleKind
2 participants