Skip to content

Commit 20cc9b9

Browse files
authored
Swift 5 (#11)
* updated travis to build with swift 5. * fixed compiler warnings from swift 5.
1 parent c02e093 commit 20cc9b9

File tree

3 files changed

+39
-39
lines changed

3 files changed

+39
-39
lines changed

Sources/ArgTree.swift

+13-13
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,12 @@ internal func parseTree(arguments: [String],
173173

174174
/** extension to support collection protocols for parsers */
175175
public extension ArgTree {
176-
public var indices: CountableRange<Int> {
176+
var indices: CountableRange<Int> {
177177
return parsers.indices
178178

179179
}
180180

181-
public subscript(bounds: Range<Int>) -> ArraySlice<Parser> {
181+
subscript(bounds: Range<Int>) -> ArraySlice<Parser> {
182182
get {
183183
return parsers[bounds]
184184
}
@@ -187,7 +187,7 @@ public extension ArgTree {
187187
}
188188
}
189189

190-
public subscript(position: Int) -> Parser {
190+
subscript(position: Int) -> Parser {
191191
get {
192192
return parsers[position]
193193
}
@@ -196,45 +196,45 @@ public extension ArgTree {
196196
}
197197
}
198198

199-
public var startIndex: Int {
199+
var startIndex: Int {
200200
return parsers.startIndex
201201
}
202202

203-
public var endIndex: Int {
203+
var endIndex: Int {
204204
return parsers.endIndex
205205
}
206206

207-
public func append(_ parser: Parser) {
207+
func append(_ parser: Parser) {
208208
parsers.append(parser)
209209
}
210210

211-
public func insert(_ parser: Parser, at i: Int) {
211+
func insert(_ parser: Parser, at i: Int) {
212212
parsers.insert(parser, at: i)
213213
}
214214

215-
public func insert(contentsOf parsers: Parser, at i: Int) {
215+
func insert(contentsOf parsers: Parser, at i: Int) {
216216
self.parsers.insert(parsers, at: i)
217217
}
218218

219219
@discardableResult
220-
public func remove(at i: Int) -> Parser {
220+
func remove(at i: Int) -> Parser {
221221
return parsers.remove(at: i)
222222
}
223223

224-
public func removeSubrange(_ bounds: Range<Int>) {
224+
func removeSubrange(_ bounds: Range<Int>) {
225225
parsers.removeSubrange(bounds)
226226
}
227227

228228
@discardableResult
229-
public func removeFirst() -> Parser {
229+
func removeFirst() -> Parser {
230230
return parsers.removeFirst()
231231
}
232232

233-
public func removeFirst(_ n: Int) {
233+
func removeFirst(_ n: Int) {
234234
parsers.removeFirst(n)
235235
}
236236

237-
public func removeAll(keepingCapacity keepCapacity: Bool = false) {
237+
func removeAll(keepingCapacity keepCapacity: Bool = false) {
238238
parsers.removeAll()
239239
}
240240

Sources/parsers/Command.swift

+13-13
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,12 @@ open class Command: ValueParser<Bool>, ParserNode {
108108

109109
/** extension to support collection protocols for parsers */
110110
public extension Command {
111-
public var indices: CountableRange<Int> {
111+
var indices: CountableRange<Int> {
112112
return parsers.indices
113113

114114
}
115115

116-
public subscript(bounds: Range<Int>) -> ArraySlice<Parser> {
116+
subscript(bounds: Range<Int>) -> ArraySlice<Parser> {
117117
get {
118118
return parsers[bounds]
119119
}
@@ -122,7 +122,7 @@ public extension Command {
122122
}
123123
}
124124

125-
public subscript(position: Int) -> Parser {
125+
subscript(position: Int) -> Parser {
126126
get {
127127
return parsers[position]
128128
}
@@ -131,44 +131,44 @@ public extension Command {
131131
}
132132
}
133133

134-
public var startIndex: Int {
134+
var startIndex: Int {
135135
return parsers.startIndex
136136
}
137137

138-
public var endIndex: Int {
138+
var endIndex: Int {
139139
return parsers.endIndex
140140
}
141141

142-
public func append(_ parser: Parser) {
142+
func append(_ parser: Parser) {
143143
parsers.append(parser)
144144
}
145145

146-
public func insert(_ parser: Parser, at i: Int) {
146+
func insert(_ parser: Parser, at i: Int) {
147147
parsers.insert(parser, at: i)
148148
}
149149

150-
public func insert(contentsOf parsers: Parser, at i: Int) {
150+
func insert(contentsOf parsers: Parser, at i: Int) {
151151
self.parsers.insert(parsers, at: i)
152152
}
153153

154-
public func remove(at i: Int) -> Parser {
154+
func remove(at i: Int) -> Parser {
155155
return parsers.remove(at: i)
156156
}
157157

158-
public func removeSubrange(_ bounds: Range<Int>) {
158+
func removeSubrange(_ bounds: Range<Int>) {
159159
parsers.removeSubrange(bounds)
160160
}
161161

162162
@discardableResult
163-
public func removeFirst() -> Parser {
163+
func removeFirst() -> Parser {
164164
return parsers.removeFirst()
165165
}
166166

167-
public func removeFirst(_ n: Int) {
167+
func removeFirst(_ n: Int) {
168168
parsers.removeFirst(n)
169169
}
170170

171-
public func removeAll(keepingCapacity keepCapacity: Bool = false) {
171+
func removeAll(keepingCapacity keepCapacity: Bool = false) {
172172
parsers.removeAll()
173173
}
174174

Sources/parsers/MultiFlag.swift

+13-13
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,12 @@ public class MultiFlag: Parser, ParserNode, ParsePathSegment {
8484

8585
/** extension to support collection protocols for parsers */
8686
public extension MultiFlag {
87-
public var indices: CountableRange<Int> {
87+
var indices: CountableRange<Int> {
8888
return parsers.indices
8989

9090
}
9191

92-
public subscript(bounds: Range<Int>) -> ArraySlice<Parser> {
92+
subscript(bounds: Range<Int>) -> ArraySlice<Parser> {
9393
get {
9494
return parsers[bounds]
9595
}
@@ -98,7 +98,7 @@ public extension MultiFlag {
9898
}
9999
}
100100

101-
public subscript(position: Int) -> Parser {
101+
subscript(position: Int) -> Parser {
102102
get {
103103
return parsers[position]
104104
}
@@ -107,43 +107,43 @@ public extension MultiFlag {
107107
}
108108
}
109109

110-
public var startIndex: Int {
110+
var startIndex: Int {
111111
return parsers.startIndex
112112
}
113113

114-
public var endIndex: Int {
114+
var endIndex: Int {
115115
return parsers.endIndex
116116
}
117117

118-
public func append(_ parser: Parser) {
118+
func append(_ parser: Parser) {
119119
parsers.append(parser)
120120
}
121121

122-
public func insert(_ parser: Parser, at i: Int) {
122+
func insert(_ parser: Parser, at i: Int) {
123123
parsers.insert(parser, at: i)
124124
}
125125

126-
public func insert(contentsOf parsers: Parser, at i: Int) {
126+
func insert(contentsOf parsers: Parser, at i: Int) {
127127
self.parsers.insert(parsers, at: i)
128128
}
129129

130-
public func remove(at i: Int) -> Parser {
130+
func remove(at i: Int) -> Parser {
131131
return parsers.remove(at: i)
132132
}
133133

134-
public func removeSubrange(_ bounds: Range<Int>) {
134+
func removeSubrange(_ bounds: Range<Int>) {
135135
parsers.removeSubrange(bounds)
136136
}
137137

138-
public func removeFirst() -> Parser {
138+
func removeFirst() -> Parser {
139139
return parsers.removeFirst()
140140
}
141141

142-
public func removeFirst(_ n: Int) {
142+
func removeFirst(_ n: Int) {
143143
parsers.removeFirst(n)
144144
}
145145

146-
public func removeAll(keepingCapacity keepCapacity: Bool = false) {
146+
func removeAll(keepingCapacity keepCapacity: Bool = false) {
147147
parsers.removeAll()
148148
}
149149

0 commit comments

Comments
 (0)