File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -205,17 +205,17 @@ extension StringProtocol {
205205 } else if token. tokenKind == . rightBrace {
206206 nesting -= 1
207207 if nesting < 0 {
208- return indexFromUTF8Offset ( token. positionAfterSkippingLeadingTrivia. utf8Offset )
208+ return index ( at : token. positionAfterSkippingLeadingTrivia)
209209 }
210210 }
211211 }
212212
213213 return endIndex
214214 }
215215
216- /// Converts a UTF-8 byte offset to a `String.Index `.
217- func indexFromUTF8Offset ( _ utf8Offset : Int ) -> String . Index {
218- let utf8Index = utf8. index ( utf8. startIndex, offsetBy: utf8Offset)
216+ /// The index at `position `.
217+ func index ( at position : AbsolutePosition ) -> String . Index {
218+ let utf8Index = utf8. index ( utf8. startIndex, offsetBy: position . utf8Offset)
219219 return String . Index ( utf8Index, within: self ) ?? endIndex
220220 }
221221}
You can’t perform that action at this time.
0 commit comments