the-sett / parser-recoverable / Parser.Recoverable.Sequence

Recoverable sequences are a variation on Parser.Advanved.sequence that allow errors in the sequence items and recover by fast forwarding to a separator or end token.

sequence : { start : String, startProb : x, separator : String, separatorProb : x, end : String, endProb : x, spaces : Parser.Recoverable.Parser c x (), forwardProb : String -> String -> x, item : Parser.Recoverable.Parser c x a, trailing : Parser.Recoverable.Trailing } -> Parser.Recoverable.Parser c x (List a)

Like Parser.Advanced.sequence but it can skip over items by fast forwarding to the next separator or end token.

When something is fast fowarded over, the forwardProb function is used to built the error that is added to the Partial result. This will be given the string skipped over, and the token consumed to get back to the restart point.