Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enh(swift): add SE-0335 existential any keyword #3515

Merged
merged 5 commits into from
Apr 3, 2022
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
8 changes: 8 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## Version 11.6.0 (maybe)

Grammars:

- enh(swift) add SE-0335 existential `any` keyword (#3515) [Bradley Mackey][]

[Bradley Mackey]: https://github.com/bradleymackey

## Version 11.5.0

Themes:
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 @@ -33,6 +33,7 @@ export const keywords = [
// will result in additional modes being created to scan for those keywords to
// avoid conflicts with other rules
'actor',
'any', // contextual
'associatedtype',
'async',
'await',
Expand Down
1 change: 1 addition & 0 deletions test/markup/swift/types.expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<span class="hljs-comment">// Functions</span>
(<span class="hljs-keyword">@escaping</span> (<span class="hljs-type">String</span>) -&gt; <span class="hljs-type">Void</span>, <span class="hljs-keyword">@autoclosure</span> () -&gt; <span class="hljs-type">String</span>) -&gt; <span class="hljs-type">String</span>
(<span class="hljs-type">Int</span>, <span class="hljs-type">String</span>...) -&gt; <span class="hljs-keyword">some</span> <span class="hljs-type">Collection</span>
(<span class="hljs-type">Int</span>, <span class="hljs-type">String</span>...) -&gt; <span class="hljs-keyword">any</span> <span class="hljs-type">SomeProtocol</span>
() <span class="hljs-keyword">throws</span> -&gt; <span class="hljs-keyword">Self</span>

<span class="hljs-comment">// Generic arguments</span>
Expand Down
1 change: 1 addition & 0 deletions test/markup/swift/types.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Swift.Array<Int>.Element
// Functions
(@escaping (String) -> Void, @autoclosure () -> String) -> String
(Int, String...) -> some Collection
(Int, String...) -> any SomeProtocol
() throws -> Self

// Generic arguments
Expand Down