Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit 9554127

Browse files
committed
Update dependencies
1 parent 774faf6 commit 9554127

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

Package.resolved

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Sources/SwiftDoc/SourceFile.swift

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,19 @@ public struct SourceFile: Hashable, Codable {
4444
assert(context.isEmpty)
4545
}
4646

47-
func symbol<Node, Declaration>(_ type: Declaration.Type, _ node: Node) -> Symbol where Declaration: API & ExpressibleBySyntax, Node == Declaration.Syntax {
48-
return symbol(node, declaration: Declaration(node))
47+
func symbol<Node, Declaration>(_ type: Declaration.Type, _ node: Node) -> Symbol? where Declaration: API & ExpressibleBySyntax, Node == Declaration.Syntax {
48+
guard let declaration = Declaration(node) else { return nil }
49+
return symbol(node, declaration: declaration)
4950
}
5051

51-
func symbol<Node: Syntax>(_ node: Node, declaration: API) -> Symbol {
52-
let documentation = try! Documentation.parse(node.documentation)
52+
func symbol<Node: Syntax>(_ node: Node, declaration: API) -> Symbol? {
53+
guard let documentation = try? Documentation.parse(node.documentation) else { return nil }
5354
let sourceLocation = sourceLocationConverter.location(for: node.position)
5455
return Symbol(declaration: declaration, context: context, documentation: documentation, sourceLocation: sourceLocation)
5556
}
5657

57-
mutating func push(_ symbol: Symbol) {
58+
mutating func push(_ symbol: Symbol?) {
59+
guard let symbol = symbol else { return }
5860
visitedSymbols.append(symbol)
5961

6062
switch symbol.declaration {

0 commit comments

Comments
 (0)