Skip to content

Commit

Permalink
Swift 5 (#11)
Browse files Browse the repository at this point in the history
* updated travis to build with swift 5.

* fixed compiler warnings from swift 5.
  • Loading branch information
dastrobu authored Apr 6, 2019
1 parent c02e093 commit 20cc9b9
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 39 deletions.
26 changes: 13 additions & 13 deletions Sources/ArgTree.swift
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,12 @@ internal func parseTree(arguments: [String],

/** extension to support collection protocols for parsers */
public extension ArgTree {
public var indices: CountableRange<Int> {
var indices: CountableRange<Int> {
return parsers.indices

}

public subscript(bounds: Range<Int>) -> ArraySlice<Parser> {
subscript(bounds: Range<Int>) -> ArraySlice<Parser> {
get {
return parsers[bounds]
}
Expand All @@ -187,7 +187,7 @@ public extension ArgTree {
}
}

public subscript(position: Int) -> Parser {
subscript(position: Int) -> Parser {
get {
return parsers[position]
}
Expand All @@ -196,45 +196,45 @@ public extension ArgTree {
}
}

public var startIndex: Int {
var startIndex: Int {
return parsers.startIndex
}

public var endIndex: Int {
var endIndex: Int {
return parsers.endIndex
}

public func append(_ parser: Parser) {
func append(_ parser: Parser) {
parsers.append(parser)
}

public func insert(_ parser: Parser, at i: Int) {
func insert(_ parser: Parser, at i: Int) {
parsers.insert(parser, at: i)
}

public func insert(contentsOf parsers: Parser, at i: Int) {
func insert(contentsOf parsers: Parser, at i: Int) {
self.parsers.insert(parsers, at: i)
}

@discardableResult
public func remove(at i: Int) -> Parser {
func remove(at i: Int) -> Parser {
return parsers.remove(at: i)
}

public func removeSubrange(_ bounds: Range<Int>) {
func removeSubrange(_ bounds: Range<Int>) {
parsers.removeSubrange(bounds)
}

@discardableResult
public func removeFirst() -> Parser {
func removeFirst() -> Parser {
return parsers.removeFirst()
}

public func removeFirst(_ n: Int) {
func removeFirst(_ n: Int) {
parsers.removeFirst(n)
}

public func removeAll(keepingCapacity keepCapacity: Bool = false) {
func removeAll(keepingCapacity keepCapacity: Bool = false) {
parsers.removeAll()
}

Expand Down
26 changes: 13 additions & 13 deletions Sources/parsers/Command.swift
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,12 @@ open class Command: ValueParser<Bool>, ParserNode {

/** extension to support collection protocols for parsers */
public extension Command {
public var indices: CountableRange<Int> {
var indices: CountableRange<Int> {
return parsers.indices

}

public subscript(bounds: Range<Int>) -> ArraySlice<Parser> {
subscript(bounds: Range<Int>) -> ArraySlice<Parser> {
get {
return parsers[bounds]
}
Expand All @@ -122,7 +122,7 @@ public extension Command {
}
}

public subscript(position: Int) -> Parser {
subscript(position: Int) -> Parser {
get {
return parsers[position]
}
Expand All @@ -131,44 +131,44 @@ public extension Command {
}
}

public var startIndex: Int {
var startIndex: Int {
return parsers.startIndex
}

public var endIndex: Int {
var endIndex: Int {
return parsers.endIndex
}

public func append(_ parser: Parser) {
func append(_ parser: Parser) {
parsers.append(parser)
}

public func insert(_ parser: Parser, at i: Int) {
func insert(_ parser: Parser, at i: Int) {
parsers.insert(parser, at: i)
}

public func insert(contentsOf parsers: Parser, at i: Int) {
func insert(contentsOf parsers: Parser, at i: Int) {
self.parsers.insert(parsers, at: i)
}

public func remove(at i: Int) -> Parser {
func remove(at i: Int) -> Parser {
return parsers.remove(at: i)
}

public func removeSubrange(_ bounds: Range<Int>) {
func removeSubrange(_ bounds: Range<Int>) {
parsers.removeSubrange(bounds)
}

@discardableResult
public func removeFirst() -> Parser {
func removeFirst() -> Parser {
return parsers.removeFirst()
}

public func removeFirst(_ n: Int) {
func removeFirst(_ n: Int) {
parsers.removeFirst(n)
}

public func removeAll(keepingCapacity keepCapacity: Bool = false) {
func removeAll(keepingCapacity keepCapacity: Bool = false) {
parsers.removeAll()
}

Expand Down
26 changes: 13 additions & 13 deletions Sources/parsers/MultiFlag.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ public class MultiFlag: Parser, ParserNode, ParsePathSegment {

/** extension to support collection protocols for parsers */
public extension MultiFlag {
public var indices: CountableRange<Int> {
var indices: CountableRange<Int> {
return parsers.indices

}

public subscript(bounds: Range<Int>) -> ArraySlice<Parser> {
subscript(bounds: Range<Int>) -> ArraySlice<Parser> {
get {
return parsers[bounds]
}
Expand All @@ -98,7 +98,7 @@ public extension MultiFlag {
}
}

public subscript(position: Int) -> Parser {
subscript(position: Int) -> Parser {
get {
return parsers[position]
}
Expand All @@ -107,43 +107,43 @@ public extension MultiFlag {
}
}

public var startIndex: Int {
var startIndex: Int {
return parsers.startIndex
}

public var endIndex: Int {
var endIndex: Int {
return parsers.endIndex
}

public func append(_ parser: Parser) {
func append(_ parser: Parser) {
parsers.append(parser)
}

public func insert(_ parser: Parser, at i: Int) {
func insert(_ parser: Parser, at i: Int) {
parsers.insert(parser, at: i)
}

public func insert(contentsOf parsers: Parser, at i: Int) {
func insert(contentsOf parsers: Parser, at i: Int) {
self.parsers.insert(parsers, at: i)
}

public func remove(at i: Int) -> Parser {
func remove(at i: Int) -> Parser {
return parsers.remove(at: i)
}

public func removeSubrange(_ bounds: Range<Int>) {
func removeSubrange(_ bounds: Range<Int>) {
parsers.removeSubrange(bounds)
}

public func removeFirst() -> Parser {
func removeFirst() -> Parser {
return parsers.removeFirst()
}

public func removeFirst(_ n: Int) {
func removeFirst(_ n: Int) {
parsers.removeFirst(n)
}

public func removeAll(keepingCapacity keepCapacity: Bool = false) {
func removeAll(keepingCapacity keepCapacity: Bool = false) {
parsers.removeAll()
}

Expand Down

0 comments on commit 20cc9b9

Please sign in to comment.