ParserType
public protocol ParserTypeA protocol to which Parser conforms. Exists as a workaround to the current 
Swift limitation that extensions cannot make concrete type non-generic.
- 
                  parse(_:)Default implementationUndocumented Default ImplementationRuns the parser on the passed in sequence.Parameter Parameter sequence: The sequence to be parsed. Throws ParseErrorif unable to parse.Returns The resulting parsed value. DeclarationSwift public protocol ParserType
- 
                  
                  The type that results from the parsing. DeclarationSwift typealias Result
- 
                  
                  The type whose sequence is parsed by the parser. DeclarationSwift typealias Token
- 
                  flatMap(_:)Extension methodReturns a Parserthat, on successful parse, continues parsing with the parser resulting from mappingtransformover its result value; returns the result of this new parser.Can be used to chain parsers together sequentially. Parameter Parameter transform: The transform to map over the result.DeclarationSwift @warn_unused_result public func flatMap<MappedResult>(transform: Result throws -> Parser<Token, MappedResult>) -> Parser<Token, MappedResult>ParameterstransformThe transform to map over the result. 
- 
                  map(_:)Extension methodReturns a Parserthat, on successful parse, returns the result of mappingtransformover its previous result valueParameter Parameter transform: The transform to map over the result.DeclarationSwift @warn_unused_result public func map<MappedResult>(transform: Result throws -> MappedResult) -> Parser<Token, MappedResult>ParameterstransformThe transform to map over the result. 
- 
                  replace(_:)Extension methodReturns a Parserthat, on successful parse, discards its previous result and returnsvalueinstead.Parameter Parameter value: The value to return on successful parse.DeclarationSwift @warn_unused_result public func replace<NewResult>(value: NewResult) -> Parser<Token, NewResult>ParametersvalueThe value to return on successful parse. 
- 
                  discard()Extension methodReturns a Parserthat, on successful parse, discards its result.DeclarationSwift @warn_unused_result public func discard() -> Parser<Token, ()>
- 
                  peek(_:)Extension methodReturns a Parserthat calls the callbackglimpsebefore returning its result.Parameter Parameter glimpse: Callback that recieves the parser’s result as input.DeclarationSwift @warn_unused_result public func peek(glimpse: Result throws -> ()) -> Parser<Token, Result>ParametersglimpseCallback that recieves the parser’s result as input. 
- 
                  require(_:)Extension methodReturns a Parserthat verifies that its result passes the condition before returning its result. If the result fails the condition, throws an error.Parameter Parameter condition: The condition used to test the result.DeclarationSwift @warn_unused_result public func require(condition: Result -> Bool) -> Parser<Token, Result>ParametersconditionThe condition used to test the result. 
- 
                  unwrap()Extension methodUndocumented DeclarationSwift public protocol ParserType
- 
                  recover(_:)Extension methodConstructs a Parserthat, on error, catches the error and attempts to recover by running theParserobtained from passing the error torecovery.Parameter Parameter recovery: A function that, given the error, will return a new parser to attempt.DeclarationSwift @warn_unused_result public func recover(recovery: ParseError throws -> Parser<Token, Result>) -> Parser<Token, Result>ParametersrecoveryA function that, given the error, will return a new parser to attempt. 
- 
                  mapError(_:)Extension methodConstructs a Parserthat, on error, catches the error and rethrows the transformed error.Parameter Parameter transform: The transform to map onto the caught message.DeclarationSwift @warn_unused_result public func mapError(transform: ParseError -> ParseError) -> Parser<Token, Result>ParameterstransformThe transform to map onto the caught message. 
- 
                  withError(_:)Extension methodConstructs a Parserthat, on error, discards the previously thrown error and throws instead a newUnableToMatcherror with the given message.Parameter Parameter description: The description to include in the error.DeclarationSwift @warn_unused_result public func withError(description: String) -> Parser<Token, Result>ParametersdescriptionThe description to include in the error. 
 ParserType Protocol Reference
        ParserType Protocol Reference