Skip to content

Commit

Permalink
enh(swift) add package keyword (highlightjs#3953)
Browse files Browse the repository at this point in the history
  • Loading branch information
bradleymackey authored Jan 5, 2024
1 parent 0fac1c6 commit 1f0e76b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Core Grammars:
- fix(javascript) incorrect function name highlighting [CY Fung][]
- fix(1c) fix escaped symbols "+-;():=,[]" literals [Vitaly Barilko][]
- fix(swift) correctly highlight generics and conformances in type definitions [Bradley Mackey][]
- enh(swift) add package keyword [Bradley Mackey][]

New Grammars:

Expand Down
1 change: 1 addition & 0 deletions src/languages/lib/kws_swift.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export const keywords = [
'operator',
'optional', // contextual
'override', // contextual
'package',
'postfix', // contextual
'precedencegroup',
'prefix', // contextual
Expand Down
1 change: 1 addition & 0 deletions test/markup/swift/keywords.expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ x <span class="hljs-keyword">is</span> <span class="hljs-type">String</span>
<span class="hljs-keyword">unowned(safe)</span> <span class="hljs-keyword">unowned(unsafe)</span>
<span class="hljs-keyword">async</span> <span class="hljs-keyword">await</span>
<span class="hljs-keyword">isolated</span> <span class="hljs-keyword">nonisolated</span>
<span class="hljs-keyword">public</span> <span class="hljs-keyword">private</span> <span class="hljs-keyword">fileprivate</span> <span class="hljs-keyword">package</span> <span class="hljs-keyword">internal</span> <span class="hljs-keyword">open</span>

<span class="hljs-keyword">#if</span>
<span class="hljs-keyword">#error</span>(<span class="hljs-string">&quot;Error&quot;</span>)
Expand Down
1 change: 1 addition & 0 deletions test/markup/swift/keywords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ fileprivate(set) internal(set) open(set) private(set) public(set)
unowned(safe) unowned(unsafe)
async await
isolated nonisolated
public private fileprivate package internal open

#if
#error("Error")
Expand Down

0 comments on commit 1f0e76b

Please sign in to comment.