Skip to content

refactor(parse/html): use token_set! instead of matches! for svelte keywords and directives helpers#9148

Merged
dyc3 merged 1 commit intomainfrom
dyc3/refactor-html-use-token-sets
Feb 20, 2026
Merged

refactor(parse/html): use token_set! instead of matches! for svelte keywords and directives helpers#9148
dyc3 merged 1 commit intomainfrom
dyc3/refactor-html-use-token-sets

Conversation

@dyc3
Copy link
Copy Markdown
Contributor

@dyc3 dyc3 commented Feb 19, 2026

Summary

I noticed this when working on #9128. No changeset because no change in behavior, except maybe performance.

Test Plan

CI should remain green

Docs

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 19, 2026

⚠️ No Changeset found

Latest commit: 5f1fdb5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions Bot added A-Parser Area: parser L-HTML Language: HTML and super languages labels Feb 19, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 19, 2026

No actionable comments were generated in the recent review. 🎉


Walkthrough

This PR refactors Svelte keyword recognition in the HTML parser: the lexer import in mod.rs was simplified to a wildcard import, and explicit match-based checks in syntax/svelte.rs were replaced with two token-set constants, SVELTE_KEYWORDS and SVELTE_DIRECTIVE_KEYWORDS, with existing public APIs unchanged.

Possibly related PRs

Suggested reviewers

  • ematipico
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: refactoring Svelte keyword matching from matches! to token_set! in the HTML parser.
Description check ✅ Passed The description relates to the changeset, explaining the motivation and noting no behavioural changes expected, though somewhat brief.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dyc3/refactor-html-use-token-sets

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Comment @coderabbitai help to get the list of available commands and usage tips.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Feb 19, 2026

Merging this PR will not alter performance

✅ 4 untouched benchmarks
⏩ 152 skipped benchmarks1


Comparing dyc3/refactor-html-use-token-sets (5f1fdb5) with main (33b8f40)

Open in CodSpeed

Footnotes

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

@dyc3 dyc3 changed the base branch from main to graphite-base/9148 February 19, 2026 21:05
@dyc3 dyc3 force-pushed the dyc3/refactor-html-use-token-sets branch from 6750e85 to cc891a3 Compare February 19, 2026 21:05
@dyc3 dyc3 force-pushed the graphite-base/9148 branch from 312b6db to aa6f837 Compare February 19, 2026 21:05
@dyc3 dyc3 changed the base branch from graphite-base/9148 to dyc3/fix-html-square-bracket-parse February 19, 2026 21:05
@dyc3 dyc3 changed the base branch from dyc3/fix-html-square-bracket-parse to graphite-base/9148 February 19, 2026 22:27
@dyc3 dyc3 force-pushed the dyc3/refactor-html-use-token-sets branch from cc891a3 to bf0f5a8 Compare February 19, 2026 22:28
@dyc3 dyc3 changed the base branch from graphite-base/9148 to dyc3/fix-html-square-bracket-parse February 19, 2026 22:28
@dyc3 dyc3 changed the base branch from dyc3/fix-html-square-bracket-parse to graphite-base/9148 February 20, 2026 12:20
@dyc3 dyc3 force-pushed the dyc3/refactor-html-use-token-sets branch from bf0f5a8 to d24c2d1 Compare February 20, 2026 12:21
@graphite-app graphite-app Bot changed the base branch from graphite-base/9148 to main February 20, 2026 12:21
@dyc3 dyc3 force-pushed the dyc3/refactor-html-use-token-sets branch from d24c2d1 to 5f1fdb5 Compare February 20, 2026 12:22
Copy link
Copy Markdown
Contributor Author

dyc3 commented Feb 20, 2026

Merge activity

  • Feb 20, 12:59 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Feb 20, 1:00 PM UTC: @dyc3 merged this pull request with Graphite.

@dyc3 dyc3 merged commit 4317572 into main Feb 20, 2026
17 checks passed
@dyc3 dyc3 deleted the dyc3/refactor-html-use-token-sets branch February 20, 2026 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Parser Area: parser L-HTML Language: HTML and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants