Skip to content

Add Swift syntax highlighting#199

Merged
ctapmex merged 1 commit into
colorer:masterfrom
kuzmeech:feature/swift-syntax-highlighting
Jan 28, 2026
Merged

Add Swift syntax highlighting#199
ctapmex merged 1 commit into
colorer:masterfrom
kuzmeech:feature/swift-syntax-highlighting

Conversation

@kuzmeech

Copy link
Copy Markdown
Contributor

Summary

  • Add swift.hrc with comprehensive Swift syntax highlighting support
  • Add .swift extension mapping in proto.hrc
  • Include test file and etalon

Features

  • Keywords: declarations (class, struct, func), statements (if, guard, switch), expressions (try, await), concurrency (actor, async)
  • String literals: regular, multiline ("""), raw (#"..."#), interpolation (\(expr))
  • Comments: line (//), block (/* */), documentation (///, /** */)
  • Attributes: @available, @main, @MainActor, etc.
  • Compiler directives: #if, #available, #file, #line, etc.
  • Numbers: decimal, binary (0b), octal (0o), hexadecimal (0x), floating point
  • Common types: Int, String, Array, Dictionary, Optional, etc.
  • Function outlining: func, init, deinit are outlined

Test

Test file covers all major Swift syntax features. Etalon generated with colorer 1.5.0.

- Add swift.hrc with support for:
  - Keywords (declarations, statements, expressions, concurrency)
  - String literals (regular, multiline, raw, interpolated)
  - Comments (line, block, doc comments)
  - Attributes (@available, @main, etc.)
  - Compiler directives (#if, #available, etc.)
  - Numbers (decimal, binary, octal, hex, float)
  - Common types (Int, String, Array, etc.)
- Add .swift extension mapping in proto.hrc
- Add comprehensive test file covering all syntax features
@ctapmex ctapmex merged commit 3cfcc53 into colorer:master Jan 28, 2026
1 check passed
@kuzmeech kuzmeech deleted the feature/swift-syntax-highlighting branch March 15, 2026 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants