Skip to content

Commit accf36d

Browse files
committed
Merge branch 'develop' for 4.2.0 release
2 parents f902113 + 1ea7d43 commit accf36d

File tree

1,196 files changed

+1279
-1179
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,196 files changed

+1279
-1179
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ Currently, SyntaxSparrow supports Swift Package Manager (SPM).
336336
To add SyntaxSparrow to your project, add the following line to your dependencies in your Package.swift file:
337337

338338
```swift
339-
.package(url: "https://github.com/CheekyGhost-Labs/SyntaxSparrow", from: "4.1.0")
339+
.package(url: "https://github.com/CheekyGhost-Labs/SyntaxSparrow", from: "4.2.0")
340340
```
341341

342342
Then, add SyntaxSparrow as a dependency for your target:

Sources/SyntaxSparrow/Public/Semantics/Components/Accessor.swift

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,26 @@ public struct Accessor: DeclarationComponent, SyntaxChildCollecting {
8787
/// ```
8888
public let body: CodeBlock?
8989

90+
/// Returns `true` when the ``Accessor/effectSpecifiers`` has the `throw` keyword.
91+
///
92+
/// For example, the following would return `true`:
93+
/// ```swift
94+
/// func example() throws
95+
/// ```
96+
public var isThrowing: Bool {
97+
return effectSpecifiers?.throwsSpecifier != nil
98+
}
99+
100+
/// Returns `true` when the ``Accessor/effectSpecifiers`` has the `throw` keyword.
101+
///
102+
/// For example, the following would return `true`:
103+
/// ```swift
104+
/// func example() async
105+
/// ```
106+
public var isAsync: Bool {
107+
return effectSpecifiers?.asyncSpecifier != nil
108+
}
109+
90110
// MARK: - Properties: SyntaxChildCollecting
91111

92112
public var childCollection: DeclarationCollection {

Sources/SyntaxSparrow/Public/Semantics/Components/Closure.swift

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,26 @@ public struct Closure: DeclarationComponent {
8888
/// **Note:** `effectSpecifiers` will be `nil` if no specifiers are found on the node.
8989
public var effectSpecifiers: EffectSpecifiers? { resolver.resolveEffectSpecifiers() }
9090

91+
/// Returns `true` when the ``Closure/effectSpecifiers`` has the `throw` keyword.
92+
///
93+
/// For example, the following would return `true`:
94+
/// ```swift
95+
/// func example() throws
96+
/// ```
97+
public var isThrowing: Bool {
98+
return effectSpecifiers?.throwsSpecifier != nil
99+
}
100+
101+
/// Returns `true` when the ``Closure/effectSpecifiers`` has the `throw` keyword.
102+
///
103+
/// For example, the following would return `true`:
104+
/// ```swift
105+
/// func example() async
106+
/// ```
107+
public var isAsync: Bool {
108+
return effectSpecifiers?.asyncSpecifier != nil
109+
}
110+
91111
// MARK: - Properties: Convenience
92112

93113
private(set) var resolver: ClosureSemanticsResolver

Sources/SyntaxSparrow/Public/Semantics/Declarations/Function.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public struct Function: Declaration, SyntaxChildCollecting {
7272
@available(
7373
*,
7474
deprecated,
75-
message: "`throwsOrRethrowsKeyword` will be deprecated in 2.0 - Please use `effectSpecifiers.throwsSpecifier` instead"
75+
message: "`throwsOrRethrowsKeyword` will be deprecated in 5.0 - Please use `effectSpecifiers.throwsSpecifier` instead"
7676
)
7777
public var throwsOrRethrowsKeyword: String? {
7878
effectSpecifiers?.throwsSpecifier
@@ -83,7 +83,7 @@ public struct Function: Declaration, SyntaxChildCollecting {
8383
@available(
8484
*,
8585
deprecated,
86-
message: "`asyncKeyword` will be deprecated in 2.0 - Please use `effectSpecifiers.asyncSpecifier` instead"
86+
message: "`asyncKeyword` will be deprecated in 5.0 - Please use `effectSpecifiers.asyncSpecifier` instead"
8787
)
8888
public var asyncKeyword: String? {
8989
effectSpecifiers?.asyncSpecifier
@@ -204,6 +204,7 @@ public struct Function: Declaration, SyntaxChildCollecting {
204204
public var isAsync: Bool {
205205
return signature.effectSpecifiers?.asyncSpecifier != nil
206206
}
207+
207208
// MARK: - Properties: Resolving
208209

209210
private(set) var resolver: FunctionSemanticsResolver

Sources/SyntaxSparrow/Public/Semantics/Declarations/Initializer.swift

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public struct Initializer: Declaration, SyntaxChildCollecting {
7171
@available(
7272
*,
7373
deprecated,
74-
message: "`throwsOrRethrowsKeyword` will be deprecated in 2.0 - Please use `effectSpecifiers.throwsSpecifier` instead"
74+
message: "`throwsOrRethrowsKeyword` will be deprecated in 5.0 - Please use `effectSpecifiers.throwsSpecifier` instead"
7575
)
7676
public var throwsOrRethrowsKeyword: String? { effectSpecifiers?.throwsSpecifier }
7777

@@ -90,6 +90,26 @@ public struct Initializer: Declaration, SyntaxChildCollecting {
9090
/// **Note:** `effectSpecifiers` will be `nil` if no specifiers are found on the node.
9191
public var effectSpecifiers: EffectSpecifiers? { resolver.resolveEffectSpecifiers() }
9292

93+
/// Returns `true` when the ``Initializer/effectSpecifiers`` has the `throw` keyword.
94+
///
95+
/// For example, the following would return `true`:
96+
/// ```swift
97+
/// func example() throws
98+
/// ```
99+
public var isThrowing: Bool {
100+
return effectSpecifiers?.throwsSpecifier != nil
101+
}
102+
103+
/// Returns `true` when the ``Initializer/effectSpecifiers`` has the `throw` keyword.
104+
///
105+
/// For example, the following would return `true`:
106+
/// ```swift
107+
/// func example() async
108+
/// ```
109+
public var isAsync: Bool {
110+
return effectSpecifiers?.asyncSpecifier != nil
111+
}
112+
93113
/// Struct representing the body of the function.
94114
///
95115
/// For example in the following declaration:

SyntaxSparrow.doccarchive/data/documentation/syntaxsparrow.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

SyntaxSparrow.doccarchive/data/documentation/syntaxsparrow/accessor.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"metadata":{"extendedModule":"Swift","role":"symbol","title":"!=(_:_:)","fragments":[{"kind":"keyword","text":"static"},{"kind":"text","text":" "},{"text":"func","kind":"keyword"},{"kind":"text","text":" "},{"text":"!=","kind":"identifier"},{"kind":"text","text":" "},{"kind":"text","text":"("},{"text":"Self","kind":"typeIdentifier"},{"text":", ","kind":"text"},{"kind":"typeIdentifier","text":"Self"},{"text":") -> ","kind":"text"},{"text":"Bool","kind":"typeIdentifier","preciseIdentifier":"s:Sb"}],"modules":[{"name":"SyntaxSparrow","relatedModules":["Swift"]}],"symbolKind":"op","externalID":"s:SQsE2neoiySbx_xtFZ::SYNTHESIZED::s:13SyntaxSparrow8AccessorV","roleHeading":"Operator"},"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/syntaxsparrow\/accessor\/!=(_:_:)"]}],"schemaVersion":{"minor":3,"patch":0,"major":0},"primaryContentSections":[{"declarations":[{"languages":["swift"],"tokens":[{"kind":"keyword","text":"static"},{"text":" ","kind":"text"},{"text":"func","kind":"keyword"},{"text":" ","kind":"text"},{"kind":"identifier","text":"!="},{"text":" ","kind":"text"},{"text":"(","kind":"text"},{"kind":"internalParam","text":"lhs"},{"kind":"text","text":": "},{"text":"Self","kind":"typeIdentifier"},{"kind":"text","text":", "},{"text":"rhs","kind":"internalParam"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"Self"},{"kind":"text","text":") -> "},{"kind":"typeIdentifier","text":"Bool","preciseIdentifier":"s:Sb"}],"platforms":["macOS"]}],"kind":"declarations"}],"hierarchy":{"paths":[["doc:\/\/SyntaxSparrow\/documentation\/SyntaxSparrow","doc:\/\/SyntaxSparrow\/documentation\/SyntaxSparrow\/Accessor","doc:\/\/SyntaxSparrow\/documentation\/SyntaxSparrow\/Accessor\/Equatable-Implementations"]]},"kind":"symbol","sections":[],"identifier":{"interfaceLanguage":"swift","url":"doc:\/\/SyntaxSparrow\/documentation\/SyntaxSparrow\/Accessor\/!=(_:_:)"},"abstract":[{"text":"Inherited from ","type":"text"},{"type":"codeVoice","code":"Equatable.!=(_:_:)"},{"text":".","type":"text"}],"references":{"doc://SyntaxSparrow/documentation/SyntaxSparrow/Accessor/!=(_:_:)":{"type":"topic","title":"!=(_:_:)","url":"\/documentation\/syntaxsparrow\/accessor\/!=(_:_:)","identifier":"doc:\/\/SyntaxSparrow\/documentation\/SyntaxSparrow\/Accessor\/!=(_:_:)","kind":"symbol","role":"symbol","abstract":[],"fragments":[{"text":"static","kind":"keyword"},{"text":" ","kind":"text"},{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"kind":"identifier","text":"!="},{"kind":"text","text":" "},{"text":"(","kind":"text"},{"kind":"typeIdentifier","text":"Self"},{"text":", ","kind":"text"},{"kind":"typeIdentifier","text":"Self"},{"kind":"text","text":") -> "},{"preciseIdentifier":"s:Sb","text":"Bool","kind":"typeIdentifier"}]},"doc://SyntaxSparrow/documentation/SyntaxSparrow":{"kind":"symbol","role":"collection","type":"topic","identifier":"doc:\/\/SyntaxSparrow\/documentation\/SyntaxSparrow","url":"\/documentation\/syntaxsparrow","abstract":[],"title":"SyntaxSparrow"},"doc://SyntaxSparrow/documentation/SyntaxSparrow/Accessor":{"type":"topic","kind":"symbol","url":"\/documentation\/syntaxsparrow\/accessor","role":"symbol","title":"Accessor","identifier":"doc:\/\/SyntaxSparrow\/documentation\/SyntaxSparrow\/Accessor","fragments":[{"kind":"keyword","text":"struct"},{"text":" ","kind":"text"},{"text":"Accessor","kind":"identifier"}],"navigatorTitle":[{"text":"Accessor","kind":"identifier"}],"abstract":[{"type":"text","text":"Represents a Swift accessor declaration."}]},"doc://SyntaxSparrow/documentation/SyntaxSparrow/Accessor/Equatable-Implementations":{"type":"topic","title":"Equatable Implementations","identifier":"doc:\/\/SyntaxSparrow\/documentation\/SyntaxSparrow\/Accessor\/Equatable-Implementations","url":"\/documentation\/syntaxsparrow\/accessor\/equatable-implementations","kind":"article","role":"collectionGroup","abstract":[]}}}
1+
{"primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"text":"static","kind":"keyword"},{"kind":"text","text":" "},{"text":"func","kind":"keyword"},{"text":" ","kind":"text"},{"kind":"identifier","text":"!="},{"kind":"text","text":" "},{"text":"(","kind":"text"},{"text":"lhs","kind":"internalParam"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"Self"},{"kind":"text","text":", "},{"kind":"internalParam","text":"rhs"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"Self"},{"text":") -> ","kind":"text"},{"preciseIdentifier":"s:Sb","kind":"typeIdentifier","text":"Bool"}],"languages":["swift"],"platforms":["macOS"]}]}],"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/syntaxsparrow\/accessor\/!=(_:_:)"]}],"sections":[],"schemaVersion":{"patch":0,"major":0,"minor":3},"metadata":{"extendedModule":"Swift","title":"!=(_:_:)","externalID":"s:SQsE2neoiySbx_xtFZ::SYNTHESIZED::s:13SyntaxSparrow8AccessorV","roleHeading":"Operator","symbolKind":"op","modules":[{"name":"SyntaxSparrow","relatedModules":["Swift"]}],"fragments":[{"kind":"keyword","text":"static"},{"kind":"text","text":" "},{"kind":"keyword","text":"func"},{"text":" ","kind":"text"},{"kind":"identifier","text":"!="},{"kind":"text","text":" "},{"text":"(","kind":"text"},{"text":"Self","kind":"typeIdentifier"},{"text":", ","kind":"text"},{"text":"Self","kind":"typeIdentifier"},{"kind":"text","text":") -> "},{"preciseIdentifier":"s:Sb","text":"Bool","kind":"typeIdentifier"}],"role":"symbol"},"abstract":[{"type":"text","text":"Inherited from "},{"type":"codeVoice","code":"Equatable.!=(_:_:)"},{"text":".","type":"text"}],"hierarchy":{"paths":[["doc:\/\/SyntaxSparrow\/documentation\/SyntaxSparrow","doc:\/\/SyntaxSparrow\/documentation\/SyntaxSparrow\/Accessor","doc:\/\/SyntaxSparrow\/documentation\/SyntaxSparrow\/Accessor\/Equatable-Implementations"]]},"kind":"symbol","identifier":{"interfaceLanguage":"swift","url":"doc:\/\/SyntaxSparrow\/documentation\/SyntaxSparrow\/Accessor\/!=(_:_:)"},"references":{"doc://SyntaxSparrow/documentation/SyntaxSparrow/Accessor/Equatable-Implementations":{"title":"Equatable Implementations","type":"topic","kind":"article","role":"collectionGroup","abstract":[],"identifier":"doc:\/\/SyntaxSparrow\/documentation\/SyntaxSparrow\/Accessor\/Equatable-Implementations","url":"\/documentation\/syntaxsparrow\/accessor\/equatable-implementations"},"doc://SyntaxSparrow/documentation/SyntaxSparrow/Accessor":{"abstract":[{"text":"Represents a Swift accessor declaration.","type":"text"}],"role":"symbol","type":"topic","navigatorTitle":[{"text":"Accessor","kind":"identifier"}],"identifier":"doc:\/\/SyntaxSparrow\/documentation\/SyntaxSparrow\/Accessor","kind":"symbol","url":"\/documentation\/syntaxsparrow\/accessor","fragments":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"kind":"identifier","text":"Accessor"}],"title":"Accessor"},"doc://SyntaxSparrow/documentation/SyntaxSparrow/Accessor/!=(_:_:)":{"title":"!=(_:_:)","type":"topic","kind":"symbol","role":"symbol","abstract":[],"fragments":[{"text":"static","kind":"keyword"},{"text":" ","kind":"text"},{"text":"func","kind":"keyword"},{"kind":"text","text":" "},{"text":"!=","kind":"identifier"},{"kind":"text","text":" "},{"kind":"text","text":"("},{"kind":"typeIdentifier","text":"Self"},{"kind":"text","text":", "},{"text":"Self","kind":"typeIdentifier"},{"text":") -> ","kind":"text"},{"kind":"typeIdentifier","preciseIdentifier":"s:Sb","text":"Bool"}],"identifier":"doc:\/\/SyntaxSparrow\/documentation\/SyntaxSparrow\/Accessor\/!=(_:_:)","url":"\/documentation\/syntaxsparrow\/accessor\/!=(_:_:)"},"doc://SyntaxSparrow/documentation/SyntaxSparrow":{"abstract":[],"url":"\/documentation\/syntaxsparrow","type":"topic","identifier":"doc:\/\/SyntaxSparrow\/documentation\/SyntaxSparrow","kind":"symbol","role":"collection","title":"SyntaxSparrow"}}}

0 commit comments

Comments
 (0)