Update syntax according to changes introduced in Xcode 8 beta 4

This commit is contained in:
David Dufresne
2016-08-06 19:08:34 -04:00
parent 7d1d4db6d3
commit 57917ea2e4
7 changed files with 8 additions and 8 deletions

View File

@@ -22,7 +22,7 @@ public extension GenericParser {
_ parsers: S
) -> GenericParser {
return parsers.reduce(GenericParser.empty, combine: <|>)
return parsers.reduce(GenericParser.empty, <|>)
}

View File

@@ -86,7 +86,7 @@ public func <(leftMsg: Message, rightMsg: Message) -> Bool {
/// `ParseError` represents parse errors. It provides the source position
/// (`SourcePosition`) of the error and an array of error messages (`Message`).
/// A `ParseError` can be returned by the function `parse`.
public struct ParseError: ErrorProtocol, CustomStringConvertible {
public struct ParseError: Error, CustomStringConvertible {
/// Return an unknown parse error.
///

View File

@@ -36,7 +36,7 @@ public enum Operator<StreamType: Stream, UserState, Result> {
}
public struct OperatorTable<StreamType: Stream, UserState, Result>:
RangeReplaceableCollection, ArrayLiteralConvertible {
RangeReplaceableCollection, ExpressibleByArrayLiteral {
/// Represents a valid position in the operator table.
public typealias Index = Int
@@ -203,7 +203,7 @@ RangeReplaceableCollection, ArrayLiteralConvertible {
let ops: OperatorsTuple = operators.reduce(
([], [], [], [], []),
combine: splitOperators
splitOperators
)
let rightAssocOp = GenericParser.choice(ops.right)

View File

@@ -288,7 +288,7 @@ public extension Parsec where UserState == () {
/// A `Stream` instance is responsible for maintaining the position of the
/// parser's stream.
public protocol Stream: Collection, ArrayLiteralConvertible {}
public protocol Stream: Collection, ExpressibleByArrayLiteral {}
extension String: Stream {

View File

@@ -25,7 +25,7 @@
/// let parser = permutation.parser.stringValue
///
public struct Permutation<StreamType: Stream, UserState, Result>:
RangeReplaceableCollection, ArrayLiteralConvertible {
RangeReplaceableCollection, ExpressibleByArrayLiteral {
/// Represents a valid position in the permutation.
public typealias Index = Int

View File

@@ -612,7 +612,7 @@ class GenericParserTests: XCTestCase {
/// implementation for the `+` operator.
protocol PlusOperator {
func +(lhs: Self, rhs: Self) -> Self
static func +(lhs: Self, rhs: Self) -> Self
}

View File

@@ -143,7 +143,7 @@ class BenchmarkTests: XCTestCase {
)
let bundle = Bundle(for: self.dynamicType)
let path = bundle.pathForResource("SampleJSON", ofType: "json")!
let path = bundle.path(forResource: "SampleJSON", ofType: "json")!
let jsonData = try! String(
contentsOfFile: path,
encoding: String.Encoding.utf8