Skip to content

refactor(parser): Modifiers::add take Modifier as param#20825

Closed
overlookmotel wants to merge 1 commit intoom/03-28-refactor_parser_make_modifier_copy_from
om/03-28-refactor_parser_modifiers_add_take_modifier_as_param
Closed

refactor(parser): Modifiers::add take Modifier as param#20825
overlookmotel wants to merge 1 commit intoom/03-28-refactor_parser_make_modifier_copy_from
om/03-28-refactor_parser_modifiers_add_take_modifier_as_param

Conversation

@overlookmotel
Copy link
Copy Markdown
Member

@overlookmotel overlookmotel commented Mar 28, 2026

Refactor. Simplify signature of Modifiers::add by making it take just Modifier instead of a ModifierKind + u32 pair. Modifier contains the same data.

Copy link
Copy Markdown
Member Author

overlookmotel commented Mar 28, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


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.

@overlookmotel overlookmotel marked this pull request as ready for review March 28, 2026 16:27
Copilot AI review requested due to automatic review settings March 28, 2026 16:27
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

Refactors the parser’s modifier bookkeeping to pass Modifier values directly, reducing parameter duplication and aligning call sites around a single value type that already encapsulates span_start + kind.

Changes:

  • Make Modifier::new a const fn to allow construction in const contexts.
  • Change internal Modifiers::add to accept a Modifier instead of (ModifierKind, u32).
  • Update modifier parsing call sites to use the new add(Modifier) signature.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 28, 2026

Merging this PR will not alter performance

✅ 48 untouched benchmarks
⏩ 8 skipped benchmarks1


Comparing om/03-28-refactor_parser_modifiers_add_take_modifier_as_param (881a81f) with om/03-28-refactor_parser_make_modifier_copy_ (bbef4f3)

Open in CodSpeed

Footnotes

  1. 8 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.

@overlookmotel
Copy link
Copy Markdown
Member Author

This depended on #20824, which I've closed because it was a small perf regression. So closing this too.

@overlookmotel overlookmotel deleted the om/03-28-refactor_parser_modifiers_add_take_modifier_as_param branch March 29, 2026 01:08
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.

2 participants