Skip to content

Commit 24a2e08

Browse files
committed
Remove unnecessary forwardindex parameter from parse function.
All collections have a forward index. And change parameter name from input to c. "input" is always a ParserInput in the rest of the code.
1 parent 7c8a93a commit 24a2e08

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

source/Parser.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,13 @@ public func eof <T> () -> Parser<T,()> {
101101
Failure to consume all of input will result in a ParserError.
102102

103103
:param: p A parser.
104-
:param: input A collection with a forward index, like a string or an array.
104+
:param: input A collection, like a string or an array.
105105

106106
:returns: Output from the parser, or a ParserError.
107107
*/
108108
public func parse
109-
<A,T,C: CollectionType, I: ForwardIndexType where C.Generator.Element == T, C.Index == I>
110-
(p: Parser<T,A>, input: C) -> Result<A,ParserError> {
109+
<A,T,C: CollectionType where C.Generator.Element == T>
110+
(p: Parser<T,A>, c: C) -> Result<A,ParserError> {
111111

112-
return ( p <* eof() ).parse(ParserInput(input)) >>- { .success($0.output) }
112+
return ( p <* eof() ).parse(ParserInput(c)) >>- { .success($0.output) }
113113
}

0 commit comments

Comments
 (0)