Skip to content

fix(swift) a name ending in a declaration keyword no longer starts a type declaration - #4555

Open
tomnvt wants to merge 1 commit into
highlightjs:mainfrom
tomnvt:fix-swift-type-declaration-boundary
Open

tomnvt wants to merge 1 commit into
highlightjs:mainfrom
tomnvt:fix-swift-type-declaration-boundary

Conversation

@tomnvt

@tomnvt tomnvt commented Oct 8, 2026 •

Copy link
Copy Markdown

Resolves #4554

Changes

  • TYPE_DECLARATION begins with \b(struct|protocol|class|extension|enum|actor), so the keyword must start a word. Before, makeInteractor followed by a line starting with a word coloured actor as a keyword and that word as a class.
  • Declarations with the name on the next line, already in type-definition.txt, are unchanged.

Checklist

  • Added markup tests: three lines in test/markup/swift/type-definition.txt, which fail without the change
  • I have read and followed our AI-assisted contributions policy (human review, no slop)

Assisted-by: Claude Opus 5.5

🤖 Generated with Claude Code

…type declaration

The type declaration rule matched `actor`, `class`, `struct`, `enum`, `protocol`
and `extension` anywhere, so `makeInteractor` followed by a line starting with a
word coloured `actor` as a keyword and that word as a class name.

Resolves highlightjs#4554

Assisted-by: Claude Opus 5.5
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(Swift) A name ending in actor, class, struct… starts a type declaration

1 participant