Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Language grammar improvements:
- enh(css) Add `font-smoothing` to attributes list for CSS (#3027) [AndyKIron][]
- fix(python) Highlight `print` and `exec` as a builtin (#1468) [Samuel Colvin][]
- fix(csharp) Fix unit being highlighted instead of uint (#3046) [Spacehamster][]
- enh(swift) add async/await keywords (#3048) [Bradley Mackey][]

Deprecations:

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 @@ -33,6 +33,8 @@ export const keywords = [
// will result in additional modes being created to scan for those keywords to
// avoid conflicts with other rules
'associatedtype',
'async',
'await',
/as\?/, // operator
/as!/, // operator
'as', // operator
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 @@ -15,6 +15,7 @@ x <span class="hljs-keyword">is</span> <span class="hljs-type">String</span>
<span class="hljs-literal">true</span> <span class="hljs-literal">false</span> <span class="hljs-literal">nil</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">#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 @@ -15,6 +15,7 @@ try? try! try
true false nil
fileprivate(set) internal(set) open(set) private(set) public(set)
unowned(safe) unowned(unsafe)
async await

#if
#error("Error")
Expand Down