Skip to content

refactor(parser): nest modifiers types in modules#20754

Merged
graphite-app[bot] merged 1 commit intomainfrom
om/03-25-refactor_parser_nest_modifiers_types_in_modules
Mar 26, 2026
Merged

refactor(parser): nest modifiers types in modules#20754
graphite-app[bot] merged 1 commit intomainfrom
om/03-25-refactor_parser_nest_modifiers_types_in_modules

Conversation

@overlookmotel
Copy link
Copy Markdown
Member

@overlookmotel overlookmotel commented Mar 25, 2026

Modifiers and ModifierKinds both have safety invariants which their methods uphold. Move them into modules so no other code can directly manipulate their fields and break these invariants.

Copy link
Copy Markdown
Member Author

overlookmotel commented Mar 25, 2026


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 changes, fast-track this PR to the front of 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.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 25, 2026

Merging this PR will not alter performance

✅ 53 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing om/03-25-refactor_parser_nest_modifiers_types_in_modules (793034c) with om/03-25-refactor_parser_re-order_modifiers_code (216e6f0)

Open in CodSpeed

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the parser’s modifier storage types (Modifiers and ModifierKinds) by nesting their concrete implementations in private modules and re-exporting the types, preventing other code from directly manipulating internal fields and breaking their safety invariants.

Changes:

  • Move Modifiers into a private mod modifiers and re-export it.
  • Move ModifierKinds into a private mod modifier_kinds and re-export it.
  • Update internal call sites to use an accessor (modifiers.kinds()) rather than field access.

@overlookmotel overlookmotel force-pushed the om/03-25-refactor_parser_nest_modifiers_types_in_modules branch from 6bd2ce0 to 793034c Compare March 25, 2026 22:13
@graphite-app
Copy link
Copy Markdown
Contributor

graphite-app bot commented Mar 26, 2026

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 Mar 26, 2026
@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Mar 26, 2026 — with Graphite App
@graphite-app graphite-app bot force-pushed the om/03-25-refactor_parser_re-order_modifiers_code branch from 216e6f0 to ddc0b5c Compare March 26, 2026 13:40
graphite-app bot pushed a commit that referenced this pull request Mar 26, 2026
`Modifiers` and `ModifierKinds` both have safety invariants which their methods uphold. Move them into modules so no other code can directly manipulate their fields and break these invariants.
@graphite-app graphite-app bot force-pushed the om/03-25-refactor_parser_nest_modifiers_types_in_modules branch from 793034c to 5f64ec6 Compare March 26, 2026 13:40
`Modifiers` and `ModifierKinds` both have safety invariants which their methods uphold. Move them into modules so no other code can directly manipulate their fields and break these invariants.
@graphite-app graphite-app bot force-pushed the om/03-25-refactor_parser_re-order_modifiers_code branch from ddc0b5c to 6277d88 Compare March 26, 2026 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-parser Area - Parser 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.

3 participants