plus
operator fun <I : Any, O1, O2, U : Any> Parser<I, O1, U>.plus(other: Parser<I, O2, U>): Parser<I, Pair<O1, O2>, U>
Sequences this parser with other, collecting both outputs into a Pair.
Sugar for pAnd: a + b is equivalent to pAnd(a, b).
Because + has higher precedence than any infix function, sequence binds tighter than choice without needing parentheses:
a + b or c + d // (a + b) or (c + d)Content copied to clipboard