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(ast): record plural names in #[plural] attr #8889

Merged

Conversation

overlookmotel
Copy link
Contributor

@overlookmotel overlookmotel commented Feb 4, 2025

Instead of hard-coding pluralized type names in Visit generator, specify the special cases with a #[plural] attribute on the type. This makes them available for other generators e.g. codegen for AST transfer.

Also pre-compute names of visit_* and walk_* methods and store them in the Schema, to avoid re-calculating them each time. This will also make it easier to add other code generators which produce Visit implementations.

@github-actions github-actions bot added A-ast Area - AST A-ast-tools Area - AST tools labels Feb 4, 2025
@github-actions github-actions bot added the C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior label Feb 4, 2025
Copy link
Contributor Author

overlookmotel commented Feb 4, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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.

Copy link

codspeed-hq bot commented Feb 4, 2025

CodSpeed Performance Report

Merging #8889 will not alter performance

Comparing 02-04-refactor_ast_record_plural_names_in_plural_attr (893339d) with main (f4662a9)

Summary

✅ 33 untouched benchmarks

Copy link

graphite-app bot commented Feb 4, 2025

Merge activity

@graphite-app graphite-app bot added 0-merge Merge with Graphite Merge Queue and removed 0-merge Merge with Graphite Merge Queue labels Feb 4, 2025
Instead of hard-coding pluralized type names in `Visit` generator, specify the special cases with a `#[plural]` attribute on the type. This makes them available for other generators e.g. codegen for AST transfer.

Also pre-compute names of `visit_*` and `walk_*` methods and store them in the `Schema`, to avoid re-calculating them each time. This will also make it easier to add other code generators which produce `Visit` implementations.
@graphite-app graphite-app bot force-pushed the 02-04-refactor_ast_tools_shorten_code branch from 33ba1db to 4b14dc2 Compare February 4, 2025 22:33
@graphite-app graphite-app bot force-pushed the 02-04-refactor_ast_record_plural_names_in_plural_attr branch from 90ab249 to 893339d Compare February 4, 2025 22:33
Base automatically changed from 02-04-refactor_ast_tools_shorten_code to main February 4, 2025 22:54
@graphite-app graphite-app bot merged commit 893339d into main Feb 4, 2025
28 checks passed
@graphite-app graphite-app bot deleted the 02-04-refactor_ast_record_plural_names_in_plural_attr branch February 4, 2025 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0-merge Merge with Graphite Merge Queue A-ast Area - AST A-ast-tools Area - AST tools C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant