Skip to content

Commit

Permalink
Merge pull request #12 from llvm-swift/update
Browse files Browse the repository at this point in the history
Update to Swift 5
  • Loading branch information
CodaFi authored Mar 26, 2019
2 parents d79ccab + 5be4b38 commit bd9cb30
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ matrix:
include:
- os: osx
language: objective-c
osx_image: xcode10
osx_image: xcode10.2
script:
- swift test
- os: linux
Expand All @@ -15,9 +15,9 @@ matrix:
env:
before_install:
- wget -q -O - https://swift.org/keys/all-keys.asc | gpg --import -
- wget https://swift.org/builds/swift-4.2-release/ubuntu1404/swift-4.2-RELEASE/swift-4.2-RELEASE-ubuntu14.04.tar.gz
- tar xzf swift-4.2-RELEASE-ubuntu14.04.tar.gz
- export PATH=${PWD}/swift-4.2-RELEASE-ubuntu14.04/usr/bin:"${PATH}"
- wget https://swift.org/builds/swift-5.0-release/ubuntu1404/swift-5.0-RELEASE/swift-5.0-RELEASE-ubuntu14.04.tar.gz
- tar xzf swift-5.0-RELEASE-ubuntu14.04.tar.gz
- export PATH=${PWD}/swift-5.0-RELEASE-ubuntu14.04/usr/bin:"${PATH}"
script:
- swift test
notifications:
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:4.2
// swift-tools-version:5.0

import PackageDescription

Expand Down
6 changes: 3 additions & 3 deletions Sources/FileCheck/FileCheck.swift
Original file line number Diff line number Diff line change
Expand Up @@ -442,15 +442,15 @@ private func readCheckStrings(in buf : UnsafeBufferPointer<CChar>, withPrefixes
// Okay, we found the prefix, yay. Remember the rest of the line, but
// ignore leading whitespace.
if !options.contains(.strictWhitespace) || !options.contains(.matchFullLines) {
guard let idx = buffer.index(where: { c in c != (" " as Character).utf8CodePoint && c != ("\t" as Character).utf8CodePoint }) else {
guard let idx = buffer.firstIndex(where: { c in c != (" " as Character).utf8CodePoint && c != ("\t" as Character).utf8CodePoint }) else {
return []
}
buffer = buffer.dropFront(idx)
}

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

// Remember the location of the start of the pattern, for diagnostics.
Expand Down
2 changes: 1 addition & 1 deletion Sources/FileCheck/Pattern.swift
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ func countNewlines(in str : String) -> (count: Int, firstIndex: String.Index?) {
// Scan for newline.

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

Expand Down

0 comments on commit bd9cb30

Please sign in to comment.