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

Refactor struct literal parse nodes. #4470

Merged
merged 1 commit into from
Nov 4, 2024

Conversation

jonmeow
Copy link
Contributor

@jonmeow jonmeow commented Nov 1, 2024

Split StructComma into StructLiteralComma and StructTypeLiteralComma in order to easily differentiate handling (remains the same in this PR).

Add "Literal" to StructField and StructTypeField because it feels inconsistent versus the other non-shared things. StructFieldDesignator remains shared between value literals and type literals.

Note I probably would've made StructFieldDesignator non-shared too, but that'd require either a lookahead of 2 (to see the separator`) or a writeback after parsing the separator, neither of which felt especially crucial for this, when what I'm really trying to do is split type literal handling a little further.

Copy link
Contributor

@chandlerc chandlerc left a comment

Choose a reason for hiding this comment

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

LG!

@jonmeow jonmeow added this pull request to the merge queue Nov 4, 2024
Merged via the queue into carbon-language:trunk with commit dd43bb9 Nov 4, 2024
10 checks passed
@jonmeow jonmeow deleted the struct-parse-nodes branch November 4, 2024 16:40
github-merge-queue bot pushed a commit that referenced this pull request Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants