File tree Expand file tree Collapse file tree 3 files changed +8
-9
lines changed
generate-swiftsyntax/templates/swiftparser
Sources/SwiftParser/generated Expand file tree Collapse file tree 3 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -128,12 +128,11 @@ public class Node {
128
128
continue
129
129
}
130
130
131
+ choices. append ( contentsOf: getChildTokenChoice ( child) )
132
+
131
133
if !child. isOptional {
132
- choices. append ( contentsOf: getChildTokenChoice ( child) )
133
134
break
134
135
}
135
-
136
- choices. append ( contentsOf: getChildTokenChoice ( child) )
137
136
}
138
137
return choices
139
138
}
Original file line number Diff line number Diff line change @@ -83,13 +83,13 @@ let IncrementalParseUtilsFile = SourceFileSyntax(leadingTrivia: copyrightHeader)
83
83
lastNonNilChildIdx != children.endIndex
84
84
{
85
85
86
- var nextPotentialNodeIndex = children.distance(from: children.startIndex, to: children. index(after: lastNonNilChildIdx) )
86
+ var nextPotentialNodeIndex = children.index(after: lastNonNilChildIdx)
87
87
88
88
if self.kind.syntaxLayout[nextPotentialNodeIndex].allSatisfy({ $0 == .unexpectedNodes }) {
89
- nextPotentialNodeIndex += 1
89
+ nextPotentialNodeIndex = children.index(after: nextPotentialNodeIndex)
90
90
}
91
91
92
- if nextPotentialNodeIndex == children.count {
92
+ if nextPotentialNodeIndex == children.endIndex {
93
93
return []
94
94
}
95
95
Original file line number Diff line number Diff line change @@ -7669,15 +7669,15 @@ extension RawSyntax {
7669
7669
lastNonNilChildIdx != children. endIndex
7670
7670
{
7671
7671
7672
- var nextPotentialNodeIndex = children. distance ( from : children . startIndex , to : children . index ( after: lastNonNilChildIdx) )
7672
+ var nextPotentialNodeIndex = children. index ( after: lastNonNilChildIdx)
7673
7673
7674
7674
if self . kind. syntaxLayout [ nextPotentialNodeIndex] . allSatisfy ( {
7675
7675
$0 == . unexpectedNodes
7676
7676
} ) {
7677
- nextPotentialNodeIndex += 1
7677
+ nextPotentialNodeIndex = children . index ( after : nextPotentialNodeIndex )
7678
7678
}
7679
7679
7680
- if nextPotentialNodeIndex == children. count {
7680
+ if nextPotentialNodeIndex == children. endIndex {
7681
7681
return [ ]
7682
7682
}
7683
7683
You can’t perform that action at this time.
0 commit comments