chain

inline fun <T, S> ParserState.chain(crossinline p: Parser<T>, crossinline separator: Parser<S>): Chain<T, S>

Parses zero or more instances of p, separated by separator, and returns the elements with their respective separators. As this parser potentially matches zero elements, it will never fail.


inline fun <T, S> chain(crossinline p: Parser<T>, crossinline separator: Parser<S>): ParserState.() -> Chain<T, S>

Creates a ParserState.chain parser.