Skip to content

Commit b227790

Browse files
committed
Remove advancedToEndOfChildren
These methods are not used anywhere and are potentially incorrect (indexInParent should probably be raw.numberOfChildren - 1). Remove the until we really need them
1 parent 669acb1 commit b227790

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

Sources/SwiftSyntax/SyntaxData.swift

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,6 @@ struct AbsoluteSyntaxPosition {
3131
return .init(offset: self.offset, indexInParent: 0)
3232
}
3333

34-
func advancedToEndOfChildren(_ raw: RawSyntax) -> AbsoluteSyntaxPosition {
35-
let newOffset = self.offset + UInt32(truncatingIfNeeded: raw.totalLength.utf8Length)
36-
let newIndexInParent = UInt32(truncatingIfNeeded: raw.numberOfChildren)
37-
return .init(offset: newOffset, indexInParent: newIndexInParent)
38-
}
39-
4034
static var forRoot: AbsoluteSyntaxPosition {
4135
return .init(offset: 0, indexInParent: 0)
4236
}
@@ -70,12 +64,6 @@ struct AbsoluteSyntaxInfo {
7064
return .init(position: newPosition, nodeId: newNodeId)
7165
}
7266

73-
func advancedToEndOfChildren(_ raw: RawSyntax) -> AbsoluteSyntaxInfo {
74-
let newPosition = position.advancedToEndOfChildren(raw)
75-
let newNodeId = nodeId.advancedToEndOfChildren(raw)
76-
return .init(position: newPosition, nodeId: newNodeId)
77-
}
78-
7967
static var forRoot: AbsoluteSyntaxInfo {
8068
return .init(position: .forRoot, nodeId: .newRoot())
8169
}
@@ -104,12 +92,6 @@ struct SyntaxIndexInTree: Hashable {
10492
return .init(indexInTree: newIndexInTree)
10593
}
10694

107-
func advancedToEndOfChildren(_ raw: RawSyntax) -> SyntaxIndexInTree {
108-
let newIndexInTree = self.indexInTree +
109-
UInt32(truncatingIfNeeded: raw.totalNodes)
110-
return .init(indexInTree: newIndexInTree)
111-
}
112-
11395
init(indexInTree: UInt32) {
11496
self.indexInTree = indexInTree
11597
}
@@ -137,11 +119,6 @@ public struct SyntaxIdentifier: Hashable {
137119
return .init(rootId: self.rootId, indexInTree: newIndexInTree)
138120
}
139121

140-
func advancedToEndOfChildren(_ raw: RawSyntax) -> SyntaxIdentifier {
141-
let newIndexInTree = self.indexInTree.advancedToEndOfChildren(raw)
142-
return .init(rootId: self.rootId, indexInTree: newIndexInTree)
143-
}
144-
145122
static func newRoot() -> SyntaxIdentifier {
146123
return .init(rootId: UInt32(truncatingIfNeeded: AtomicCounter.next()),
147124
indexInTree: .zero)

0 commit comments

Comments
 (0)