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
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,9 @@ func syntaxNode(nodesStartingWith: [Character]) -> SourceFileSyntax {
) {
AccessorDeclSyntax(accessorSpecifier: .keyword(.get)) {
if child.isOptional {
StmtSyntax("return data.child(at: \(raw: index), parent: Syntax(self)).map(\(childType).init)")
StmtSyntax("return data.child(at: \(raw: index)).map(\(childType).init)")
} else {
StmtSyntax("return \(childType)(data.child(at: \(raw: index), parent: Syntax(self))!)")
StmtSyntax("return \(childType)(data.child(at: \(raw: index))!)")
}
}

Expand Down
4 changes: 1 addition & 3 deletions Sources/SwiftSyntax/SyntaxData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,8 @@ struct SyntaxData {
/// data's layout.
///
/// - Parameter index: The index to create and cache.
/// - Parameter parent: The parent to associate the child with. This is
/// normally the Syntax node that this `SyntaxData` belongs to.
/// - Returns: The child's data at the provided index.
func child(at index: Int, parent: Syntax) -> SyntaxData? {
func child(at index: Int) -> SyntaxData? {
if raw.layoutView!.children[index] == nil { return nil }
var iter = RawSyntaxChildren(absoluteRaw).makeIterator()
for _ in 0..<index { _ = iter.next() }
Expand Down
334 changes: 167 additions & 167 deletions Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesAB.swift

Large diffs are not rendered by default.

394 changes: 197 additions & 197 deletions Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesC.swift

Large diffs are not rendered by default.

312 changes: 156 additions & 156 deletions Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesD.swift

Large diffs are not rendered by default.

434 changes: 217 additions & 217 deletions Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesEF.swift

Large diffs are not rendered by default.

352 changes: 176 additions & 176 deletions Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesGHI.swift

Large diffs are not rendered by default.

410 changes: 205 additions & 205 deletions Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesJKLMN.swift

Large diffs are not rendered by default.

422 changes: 211 additions & 211 deletions Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesOP.swift

Large diffs are not rendered by default.

366 changes: 183 additions & 183 deletions Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesQRS.swift

Large diffs are not rendered by default.

376 changes: 188 additions & 188 deletions Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesTUVWXYZ.swift

Large diffs are not rendered by default.