refactor(ast_tools): simplify AstKind generator#20942
Merged
graphite-app[bot] merged 1 commit intomainfrom Apr 1, 2026
Merged
Conversation
Member
Author
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Apr 1, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes dead code from the AstKind code generator by eliminating enum-handling paths, reflecting the current rule that AstKind variants are generated only for structs.
Changes:
- Simplified the generation loop by early-skipping non-struct
TypeDefs viaas_struct(). - Simplified
node_idsetter generation by removingTypeDefpattern matching in favor of direct struct inspection. - Updated
as_*method name generation to use the struct definition directly.
Contributor
Merge activity
|
`AstKind` generator had code paths to handle enums which have an `AstKind`. We made `AstKind`s only apply to structs a few months back, so this is now dead code. Remove it.
4f23c14 to
b782a4b
Compare
7463340 to
da91ccc
Compare
Base automatically changed from
om/04-01-refactor_ast_tools_simplify_structsandenums_iterator
to
main
April 1, 2026 18:17
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.

AstKindgenerator had code paths to handle enums which have anAstKind. We madeAstKinds only apply to structs a few months back, so this is now dead code. Remove it.