Skip to content

Commit

Permalink
Remove unnecessary forwardindex parameter from parse function.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kareman committed Jun 6, 2015
1 parent 7c8a93a commit 24a2e08
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions source/Parser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ public func eof <T> () -> Parser<T,()> {
Failure to consume all of input will result in a ParserError.

:param: p A parser.
:param: input A collection with a forward index, like a string or an array.
:param: input A collection, like a string or an array.

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

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

0 comments on commit 24a2e08

Please sign in to comment.