Skip to content

Commit

Permalink
enh(swift) add @resultBuilder attribute (#3151)
Browse files Browse the repository at this point in the history
* enh(swift) add @resultBuilder attribute

This feature will land in Swift 5.4 -> https://github.com/apple/swift-evolution/blob/main/proposals/0289-result-builders.md

* (swift) add @resultBuilder markup test
  • Loading branch information
bradleymackey authored Apr 19, 2021
1 parent 0cd2ab1 commit 39fc70f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ Parser:

Grammars:

- enh(swift) add `@resultBuilder` attribute (#3151) [Bradley Mackey][]
- enh(processing) added `pde` alias (#3142) [Dylan McBean][]
- enh(thrift) Use proper scope for types [Josh Goebel][]
- enh(java) Simplified class-like matcher (#3078) [Josh Goebel][]
Expand Down Expand Up @@ -96,6 +97,7 @@ Dev Improvements:

- (chore) greatly improve match scope visualization in dev tool (#3126) [NullVoxPopuli][]

[Bradley Mackey]: https://github.com/bradleymackey
[Dylan McBean]: https://github.com/DylanMcBean
[Josh Goebel]: https://github.com/joshgoebel
[Ryan Mulligan]: https://github.com/ryantm
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 @@ -297,6 +297,7 @@ export const keywordAttributes = [
'objcMembers',
'propertyWrapper',
'requires_stored_property_inits',
'resultBuilder',
'testable',
'UIApplicationMain',
'unknown',
Expand Down
1 change: 1 addition & 0 deletions test/markup/swift/attributes.expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@

<span class="hljs-keyword">@propertyWrapper</span>
<span class="hljs-meta">@SomeWrapper</span>(value: <span class="hljs-number">1.0</span>, other: <span class="hljs-string">&quot;string&quot;</span>, bool: <span class="hljs-literal">false</span>)
<span class="hljs-keyword">@resultBuilder</span>

@ notAnAttribute
1 change: 1 addition & 0 deletions test/markup/swift/attributes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@

@propertyWrapper
@SomeWrapper(value: 1.0, other: "string", bool: false)
@resultBuilder

@ notAnAttribute

0 comments on commit 39fc70f

Please sign in to comment.