Skip to content

Commit bd9cb30

Browse files
authoredMar 26, 2019
Merge pull request #12 from llvm-swift/update
Update to Swift 5
2 parents d79ccab + 5be4b38 commit bd9cb30

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed
 

‎.travis.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ matrix:
55
include:
66
- os: osx
77
language: objective-c
8-
osx_image: xcode10
8+
osx_image: xcode10.2
99
script:
1010
- swift test
1111
- os: linux
@@ -15,9 +15,9 @@ matrix:
1515
env:
1616
before_install:
1717
- wget -q -O - https://swift.org/keys/all-keys.asc | gpg --import -
18-
- wget https://swift.org/builds/swift-4.2-release/ubuntu1404/swift-4.2-RELEASE/swift-4.2-RELEASE-ubuntu14.04.tar.gz
19-
- tar xzf swift-4.2-RELEASE-ubuntu14.04.tar.gz
20-
- export PATH=${PWD}/swift-4.2-RELEASE-ubuntu14.04/usr/bin:"${PATH}"
18+
- wget https://swift.org/builds/swift-5.0-release/ubuntu1404/swift-5.0-RELEASE/swift-5.0-RELEASE-ubuntu14.04.tar.gz
19+
- tar xzf swift-5.0-RELEASE-ubuntu14.04.tar.gz
20+
- export PATH=${PWD}/swift-5.0-RELEASE-ubuntu14.04/usr/bin:"${PATH}"
2121
script:
2222
- swift test
2323
notifications:

‎Package.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:4.2
1+
// swift-tools-version:5.0
22

33
import PackageDescription
44

‎Sources/FileCheck/FileCheck.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -442,15 +442,15 @@ private func readCheckStrings(in buf : UnsafeBufferPointer<CChar>, withPrefixes
442442
// Okay, we found the prefix, yay. Remember the rest of the line, but
443443
// ignore leading whitespace.
444444
if !options.contains(.strictWhitespace) || !options.contains(.matchFullLines) {
445-
guard let idx = buffer.index(where: { c in c != (" " as Character).utf8CodePoint && c != ("\t" as Character).utf8CodePoint }) else {
445+
guard let idx = buffer.firstIndex(where: { c in c != (" " as Character).utf8CodePoint && c != ("\t" as Character).utf8CodePoint }) else {
446446
return []
447447
}
448448
buffer = buffer.dropFront(idx)
449449
}
450450

451451
// Scan ahead to the end of line.
452-
let EOL : Int = buffer.index(of: ("\n" as Character).utf8CodePoint)
453-
?? buffer.index(of: ("\r" as Character).utf8CodePoint)
452+
let EOL : Int = buffer.firstIndex(of: ("\n" as Character).utf8CodePoint)
453+
?? buffer.firstIndex(of: ("\r" as Character).utf8CodePoint)
454454
?? buffer.count - 1
455455

456456
// Remember the location of the start of the pattern, for diagnostics.

‎Sources/FileCheck/Pattern.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ func countNewlines(in str : String) -> (count: Int, firstIndex: String.Index?) {
447447
// Scan for newline.
448448

449449
// If we can't find a newline, bail.
450-
guard let EOL = range.index(of: "\n") ?? range.index(of: "\r") else {
450+
guard let EOL = range.firstIndex(of: "\n") ?? range.firstIndex(of: "\r") else {
451451
return (newlineCount, firstNewLine)
452452
}
453453

0 commit comments

Comments
 (0)
Please sign in to comment.