Skip to content

Commit

Permalink
enh(swift) add isolated/nonisolated keywords (#3296)
Browse files Browse the repository at this point in the history
* Swift: add isolated/nonisolated keywords
* Swift: add isolated/nonisolated markup tests
  • Loading branch information
bradleymackey committed Jul 31, 2021
1 parent 2c617f5 commit 4fb68ad
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,17 @@ Parser:

- fix(types) Fix some type definition issues (#3274) [Josh Goebel][]

Grammars:

- enh(swift) Add `isolated`/`nonisolated` keywords (#3296) [Bradley Mackey][]

New Languages:

- Added 3rd party X# grammar to SUPPORTED_LANGUAGES [Patrick Kruselburger][]

[Josh Goebel]: https://github.com/joshgoebel
[Patrick Kruselburger]: https://github.com/PatrickKru
[Bradley Mackey]: https://github.com/bradleymackey


## Version 11.1.0
Expand Down
2 changes: 2 additions & 0 deletions src/languages/lib/kws_swift.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ export const keywords = [
'internal',
'in',
'is', // operator
'isolated', // contextual
'nonisolated', // contextual
'lazy', // contextual
'let',
'mutating', // 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 @@ -16,6 +16,7 @@ x <span class="hljs-keyword">is</span> <span class="hljs-type">String</span>
<span class="hljs-keyword">fileprivate(set)</span> <span class="hljs-keyword">internal(set)</span> <span class="hljs-keyword">open(set)</span> <span class="hljs-keyword">private(set)</span> <span class="hljs-keyword">public(set)</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">#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 @@ -16,6 +16,7 @@ true false nil
fileprivate(set) internal(set) open(set) private(set) public(set)
unowned(safe) unowned(unsafe)
async await
isolated nonisolated

#if
#error("Error")
Expand Down

0 comments on commit 4fb68ad

Please sign in to comment.