one Of
Tries the given parsers in order, returning the result of the first one to succeed. Fails with the error message of the last parser, if none of the given parsers succeed.
Tries the given parsers in order, returning the result of the first one to succeed. Fails if none of the given parsers succeed.
ps is a list of label-parser pairs, where the labels are used to construct the error message in case of failure.
inline fun <T> oneOf(vararg ps: Pair<String, Parser<T>>): ParserState.() -> T
Content copied to clipboard
Creates a ParserState.oneOf parser.